4 ms·
I love clojure/clojurescript, but will core.typed really be comparable to Haskell's type system?
by Fishkins 13y ago
I love clojure/clojurescript, but will core.typed really be comparable to Haskell's type system?
- swannodette 13y agoHaskell's type system is crafted for Haskell and core.typed is crafted for Clojure. I don't see how they can be compared given how different the two languages are.
- ithkuil 13y agowell, they still can be compared at some level. For example, haskell type checker is turing complete, i.e. you can do type level computation (see http://www.haskell.org/haskellwiki/Type_arithmetic http://www.haskell.org/haskellwiki/Type_arithmetic)
- colanderman 13y agoturing complete, i.e. you can do type level computation Turing completeness → computation, but the converse is not valid (i.e. computation → Turing completeness is not necessarily true). e.g. GADTs allow for some amount of type-level computation, but they do not in and of themselves form a Turing complete system. Alas, looking at your link, it does seem that Haskell's type system is sadly Turing-complete.
- tome 13y agoOnly if you use some extensions. http://www.haskell.org/haskellwiki/Type_SK http://www.haskell.org/haskellwiki/Type_SK
- ithkuil 13y agocorrect, "turing complete, i.e. you can do any possible computation at the type level." I don't know if I feel joy or sadness, but I have the feeling that if type level computation is allowed, then it's better to be turing complete than falling short while giving the illusion to be useful. As for the practical applications of a powerful type system, I know about this (but I would be interested into finding more examples, as most of the information about that is very theoretical): http://hackage.haskell.org/package/HList http://hackage.haskell.org/package/HList (http://userpages.uni-koblenz.de/~laemmel/TheEagle/dl/KiselyovLS04.pdf http://userpages.uni-koblenz.de/~laemmel/TheEagle/dl/Kiselyo...)
- tome 13y agoI'd say it the other way round: that Haskell was crafted for Haskell's type system, i.e. Hindley-Milner. (Although Haskell also has type-classes which make my statement not quite true)
- swannodette 13y agoI'd say your statement is not true, type classes arrived early on and adjustments needed to made. I imagine adjustments will continue to be made as Haskell evolves as a language. It is true that Haskell & its type system evolve together whereas core.typed must follow Clojure wherever it may go.
- tome 13y agoMmm, and Haskell added higher-kinded types which are not part of Hindley-Milner, so yes my initial statement was too simplistic.