Removal candidates in patterns

Ganesh Sittampalam ganesh at
Thu Jan 26 19:15:27 EST 2006

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.



More information about the Haskell-prime mailing list