[Haskell-cafe] Confused about type seen in the wild
Andres Löh
andres at well-typed.com
Thu Apr 10 18:35:46 UTC 2014
I also find this scary. Even this works:
Prelude> let whee :: (Show a, Eq a, a) => Bool; whee x = x == x && null (show x)
Prelude> :t whee
whee :: (Eq a, Show a) => a -> Bool
But:
Prelude> let test :: (Eq a) => a => b => a; test = undefined
<interactive>:35:13:
Illegal polymorphic or qualified type: (b) => a
Perhaps you intended to use -XRankNTypes or -XRank2Types
In the type signature for `test': test :: Eq a => a => b => a
Prelude> :set -XRankNTypes
Prelude> let test :: (Eq a) => a => b => a; test = undefined
<interactive>:8:13:
Illegal constraint: b (Use -XConstraintKinds to permit this)
In the type signature for `test': test :: Eq a => a => b => a
So this is what I'd also expect for "a" to happen. I think this is a bug.
Cheers,
Andres
--
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com
Registered in England & Wales, OC335890
250 Ice Wharf, 17 New Wharf Road, London N1 9RF, England
More information about the Haskell-Cafe
mailing list