
26 Jan
2006
26 Jan
'06
7:15 p.m.
On Thu, 26 Jan 2006, Ian Lynagh wrote:
A Natural class would also make some sense. Then we could have, e.g., (^) :: (Num a, Natural b) => a -> b -> a although that does cause problems with Haskell's libraries being strongly biased towards Int (and changing that probably breaks an awful lot of code).
You could make "instance Natural Int" (etc) available in some module that legacy programs could import.
So in conclusion, I'm in favour of keeping both n+k and k patterns, and restricting n+k patterns to Natural types and k patterns to Integral types.
I like this idea. Cheers, Ganesh