
On 14-04-08 11:11 PM, Alexander Solla wrote:
mathJaxField :: Monad m
=> RenderMessage (HandlerSite m) FormMessage
=> Field m MathJax
Notice that there are two type arrows (=>). Interestingly,
mathJaxField :: (Monad m
, RenderMessage (HandlerSite m) FormMessage
) => Field m MathJax
compiles too. So it looks like currying/uncurrying, at the type level. But when did this start? I'm using GHC 7.6.3
Yes, GHC accepts "X => Y => Z" and makes it "(X, Y) => Z". In fact, go wilder: whee :: Show a => Eq a => a => Bool whee x = x == x && null (show x) It is valid and it means (Show a, Eq a) => a -> Bool. Try it! My understanding is that when the type checker has to support all those generalizations like ConstraintKind, DataKinds, etc etc, it becomes so general that some traditional distinctions vanish.