[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
Hi All,
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???
--
Best Regards,
Boon Hui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160829/0741721b/attachment.html>
More information about the Beginners
mailing list