core-typed

Typed Clojure, an optional type system for Clojure
andrewboltachev 2015-12-07T10:09:26.000017Z

Hi. There's simple snippet http://dpaste.com/36BFRB1 and error I get: http://dpaste.com/3VT6PFR Do you think it's my fault (doesn't seem to be) and what workaround could I have for this?

andrewboltachev 2015-12-07T10:10:45.000018Z

the reason of an error is that core.typed thinks that I'm trying to pass 'foo to the function rest by accident, which I'm not ('cause filtering it out explicitly with an if)

andrewboltachev 2015-12-07T10:12:57.000019Z

(this breaks me from porting core of my library to core.typed, which I want to do to find erros in peripheral part of it)

minimal 2015-12-07T11:11:36.000020Z

@andrewboltachev: you can’t call rest on a parameterised type

andrewboltachev 2015-12-07T11:12:04.000021Z

@minimal: what type can I call it on?

minimal 2015-12-07T11:12:06.000022Z

a type of a -> a can only be the identity function

minimal 2015-12-07T11:13:12.000025Z

you can call rest on anything seqable, so most/any of the collection types

andrewboltachev 2015-12-07T11:13:34.000026Z

isn't (t/Seq t/Int) seqable?

minimal 2015-12-07T11:14:05.000027Z

oh sorry ignore me

minimal 2015-12-07T11:14:20.000028Z

completely missed the alias, monday morning

andrewboltachev 2015-12-07T11:14:31.000029Z

got it :simple_smile:

andrewboltachev 2015-12-07T11:14:49.000030Z

well, my actual problem now is with predicates/filters

andrewboltachev 2015-12-07T11:14:58.000031Z

I can't get them right anyway

minimal 2015-12-07T12:09:36.000032Z

@andrewboltachev: it works if you don’t quote foo in the type alias

minimal 2015-12-07T12:10:43.000033Z

(t/defalias T1
  (t/U (t/Seq t/Int) (t/Val foo)))

andrewboltachev 2015-12-07T13:52:14.000034Z

@minimal: interesting... thanks!

andrewboltachev 2015-12-07T17:57:39.000035Z

Hi. What I'm doing wrong if I'm getting assertion errors while checking the ns via t/check-ns?

java.lang.AssertionError: Assert failed: (every? r/Type? types)