I don't know a lot about type-classes, but I'm doubtful that Typed Clojure could help make protocols like them. I would expect a whole different dispatch system would need to be designed. But that's mostly a hunch. Very interesting problem.
If you want to play around with this kind of stuff immediately, check out Typed Racket. The Typed Clojure implementation is in alpha and might not be very friendly yet :) That said, please try it out!
Shen's dedication to providing functional concepts such as partial application really interests me, but I find Clojure's practical nature even more enticing. Perhaps Typed Racket and this type system for Clojure will provide the best of both worlds!
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.175...
homepages.inf.ed.ac.uk/wadler/papers/blame/blame.pdf
Not at all.
Multimethods were Hickeys solution to polymorphism before the Haskell enthusiasts managed to preach the gospel of type classes to him. Today, they are more or less deprecated as a solution to a problem.
This is categorically false. Multimethods solve a certain problem "open arbitrary function dispatch". Nothing in Clojure aside from multimethods solves this problem. There are many projects that use multimethods to their great advantage, including, but not limited to:
* Clojure
* ClojureScript
* ClojureScript One
I'm a huge type safety fan (see http://roy.brianmckenna.org/) so this is pretty amazing. I'm definitely going to play around with Ambrose's work.
Had a quick look, it's really exciting that the algo.monads was almost completely type-checkable with this system.
Leaves me with a couple of questions:
Multimethods are untyped. Anyone able to comment on how often multimethods are used in idiomatic Clojure code?
Anyone know if this work could eventually allow protocols to become full type-classes (allowing dispatch based on return type of protocol methods)? Am I misunderstanding how protocols are compiled?
Hopefully the videos for Typed Clojure at Clojure Conj 2012 will be posted soon after the talk is given :)
My only fear is that optional typing would be less useful than optional untyping. When you have libraries that are untyped, they're a pain to use from a typed language. The other way around is not true.