[Haskell-cafe] Confused about type seen in the wild
felipe.lessa at gmail.com
Thu Apr 10 17:43:00 UTC 2014
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
> 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
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!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 901 bytes
Desc: OpenPGP digital signature
More information about the Haskell-Cafe