[Haskell-beginners] Why is the type constraint different from signature?
Lai Boon Hui
laiboonh at gmail.com
Mon Aug 29 14:56:46 UTC 2016
can some one explain to me why
ghci> let f:: (Ord a, Num b) => a -> b -> a ; f=undefined
ghci> :t f 1 2
ghci> f 1 2 :: (Num a, Ord a) => a
The initial type signature just required *a* to be a type that is an
instance of Ord but after it had the additional constraint of Ord as well???
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners