core-typed

Typed Clojure, an optional type system for Clojure
2020-02-26T02:36:54.095800Z

phew all the coordinate renames are done. exactly zero people should care right now, but I can get on with actual work. 1.0.10 is out https://github.com/typedclojure/typedclojure/blob/master/UPGRADING.md#from-typedclojure-107-to-typedclojure-1010

2020-02-26T03:12:50.096100Z

it begins ... https://github.com/typedclojure/typedclojure/tree/master/typed/clj.spec

🤞 4
2020-02-26T04:20:07.097Z

s/conform'ing polymorphic clojure.core/map, example & counter-example https://github.com/typedclojure/typedclojure/blob/a2e4f7803ce5ff4e10285f230120de56bc9da048/typed/clj.spec/test/typed_test/clj/spec.clj#L37-L52

2020-02-26T04:20:31.097500Z

this is the PoC I had last week 🙂

2020-02-26T04:21:54.098400Z

@yogsototh ^^ you asked me last week if I had a counter-example for clojure.core/map's polymorphic spec 🙂

2020-02-26T23:52:03.099200Z

(s/register
  ::map1-dependent
  (all [:N (tvar-spec :kind nat-int?
                      :gen #(gen/large-integer
                              {:min 0
                               :max 100}))
        :x (tvar-spec :kind ::t/any-spec?)
        :y (tvar-spec :kind ::t/any-spec?)]
       (s/fspec :args (s/cat :fn (s/fspec :args (s/cat :x (tvar :x))
                                          :ret (tvar :y))
                             :colls (s/every (tvar :x)
                                             :count (tvar :N)))
                :ret (s/every (tvar :y)
                              :count (tvar :N)))))