[Haskell-beginners] question on types
Jake Penton
djp at arqux.com
Fri Jul 29 18:14:30 CEST 2011
On 2011-07-29, at 11:22 AM, Brandon Allbery wrote:
> Ask yourself this: is True *every* instance of Ord? You are expecting
> it to be an "any", but it's an "every" (forall).
>
> By the way, True happens to be an instance of Ord but it doesn't have
> to be. You're working backwards here, I think. It happens that
> useful operations on things in class Ord generally produce Bool; that
> doesn't mean Bool must be Ord.
>
Right - actually, I did not expect it to compile. I gave the code as, perhaps, a counterexample to what some other responses seemed to be asserting, although it is possible I did not get their point(s) correctly. They seemed to say that adding a constraint is of itself what makes the cases that used numeric literals work. But it seems (as described in Brent Yorgey's post) that there is more to it than that.
- J -
More information about the Beginners
mailing list