[ANN] core.typed 0.1.18

71 views
Skip to first unread message

Ambrose Bonnaire-Sergeant

unread,
Jul 31, 2013, 2:31:27 PM7/31/13
to core.typed, clojure
Hi,

To mark the mid-GSoC evaluations, I'm happy to release another
core.typed version.

Highlights:

- type checking speed enhancements
- some usages of `every?` now update local types as expected
  - currently works best on things exactly of type IPersistentCollection (aka. a new alias Coll)

eg. cast a (Coll Any) to (Coll Number):
  (cf (let [a (ann-form [] (Coll Any))] 
         (assert (every? number? a)) 
         a))
  ;=> (Coll Number)

- combining keys/vals with every? updates an IPersistentMap type as you would expect

eg. cast a (IPM Any Any) to (IPM Number Any)
(cf (let [a (ann-form {} (IPersistentMap Any Any))] 
       (assert (every? number? (keys a))) 
       a))
;=> (IPersistentMap Number Any

- New `Extends` type constructor can say which interfaces a type does *not* extend (helps fix some unsoundness)

Thanks,
Ambrose

Ambrose Bonnaire-Sergeant

unread,
Jul 31, 2013, 2:44:39 PM7/31/13
to core.typed, clojure
Probably even more exciting is that we can handle (filter identity coll), although it
currently requires instantiating identity:

(cf (filter (inst identity (U nil Number)) [1 nil 2]))
;=> (Seqable Number)

Finally!
Ambrose

Reply all
Reply to author
Forward
0 new messages