Craig Dickson wrote:
> Why do you find this makes a significant difference? Personally, I find
> 
>     f x = ... f (x - 1)
> 
> much more intuitive than
> 
>    f (x + 1) = ... f x
> 
> I see no advantage in the n+k version.
> 
> 

I agree. n+k patterns make sense for a type of Natural Numbers (including 0), 
but not for general Integral types.

They are also dangerous because they are defined in terms of < and -, which, 
in a user-defined type, need not obey the usual laws, e.g. you cannot assume 
that 0 < 1 holds.

The problem is that dropping them would break lots of stuff - but probably 
more textbooks than programs.

--brian



Reply via email to