3 ms·
How does Coalton's type system compare to that of Typed Clojure? Recently, Typed Clojure received huge improvements to local type inference such that (let [f
by koito17 3y ago
How does Coalton's type system compare to that of Typed Clojure? Recently, Typed Clojure received huge improvements to local type inference such that
(let [f (comp (fn [y] y)
(fn [x] x))]
(f 1))
can be inferred to return a value with type (Val 1) through serious amounts of symbolic execution.
Does Coalton have similar capabilities? I would love to try out some kind of "typed Common Lisp", especially since I prefer Common Lisp over Clojure any day, but recent advancements in Typed Clojure have been raising my eyebrows, as they it can finally do things that were once considered infeasible (declaring types for higher-order functions and heterogeneous collections in a dynamic language).
- reikonomusha 3y agoCoalton's type system is roughly the same as Haskell's or OCaml. That includes full type inference, type variables, type classes, etc.
- koito17 3y agoAh, so it is closer to a Hindley–Milner type system than something like Typed Racket's type system. Typed Clojure is largely based off of the latter and takes inspiration from some papers on local type inference[1] and [2] to handle multi-arity functions. I should look more into Coalton. Thanks for responding. [1] https://www.cis.upenn.edu/~bcpierce/papers/lti.pdf https://www.cis.upenn.edu/~bcpierce/papers/lti.pdf [2] https://www2.ccs.neu.edu/racket/pubs/esop09-sthf.pdf https://www2.ccs.neu.edu/racket/pubs/esop09-sthf.pdf