n+k patterns

carlos.scheidegger@via-rs.net carlos.scheidegger@via-rs.net
Wed, 30 Jan 2002 21:46:02 -0200


On 30 Jan 2002, at 12:01, haskell-request@haskell.org wrote:

> Yet for floats there may not be such an x (y = positive zero), or there may
>  be more than one (y=2^n with n chosen so that 2^n+1 is not 
exactly representable but 2^n-1 is, then
> x could be 2^n or 2^n-1).

Well, I am just a newbie in Haskell, but this reason, together with 
the fact that n+k patterns were designed to be used in inductive 
definitions do make me strongly favor the restriction of n+k patterns 
to the class Integral (Malcolm Wallace pointed out that there may 
be a use for Rational n+k patterns, but I think it would only be 
advisable in the case that Rational numbers were implemented 
explicitly with numerators and denominators).

Besides that, what about deprecating n+k patterns in future 
Haskell reports? :)

just my $0.02,
Carlos Eduardo Scheidegger