
18 Sep
2011
18 Sep
'11
5:19 a.m.
+1 on removing the Show constraint. I abstain on the Eq constraint - either way is fine with me. Jon Fairbairn wrote:
But pattern matching for Double or Float is a Bad Thing, so wouldn’t the solution to this be to put the EQ constraint somewhere else, such as Integral where it would be less improper?
The Badness comes from the Eq instance itself. Once that instance exists, using it for pattern matching isn't any worse than equating with a Num literal in an expression. If we are going to have an Eq constraint at all, it might as well be on Num. Thanks, Yitz