[Haskell-cafe] Question about Haskell types
Pete Chown
1 at 234.cx
Sun Feb 26 10:03:46 EST 2006
I've been trying to get to the point with Haskell where I can write
useful programs, and I've come across something I don't understand with
the type system. I hope this is the right place to ask.
I came up with the following list of declarations:
a = (<)
b x = (x <)
c x y = (x < y)
It turns out that 'a' is badly typed and gives an error at compile time.
'B' and 'c' are equivalent and have type "Ord a => a -> a -> Bool".
What I don't understand is why 'a' doesn't behave the same way as the
other two.
Thanks for any help you can give me, and in the meantime I'll go back to
relearning everything I thought I knew about programming. :-)
Pete
More information about the Haskell-Cafe
mailing list