
Em 10-04-2014 13:27, Albert Y. C. Lai escreveu:
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.
What? Shouldn't that be a bug? $ ghci -XHaskell98 GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> let f :: a => a; f = id <interactive>:2:15: Predicate `a' used as a type In the type signature for `f': f :: a => a Prelude> let f :: Eq a => a => a; f = id Not even with Haskell98 turned on! -- Felipe.