Ranges and the Enum class

Wolfgang Jeltsch wolfgang at jeltsch.net
Tue Mar 21 17:19:08 EST 2006


Am Dienstag, 21. März 2006 02:47 schrieb Aaron Denney:
> [...]

> > No, I use them.  In my opinion, it makes much more sense to write succ n
> > than n + 1.
>
> Agreed, for non-arithmetical types.

I think, it's perfectly sensible for arithmetical types like Integer.  If you 
mean “the next integer” then succ n is the most logical thing to write.  If 
you write n + 1 instead, you invoke a more complex operation (addition) with 
a special constant as one of its parameters, and this obfuscates what you 
actually mean, in my opinion.

Best wishes,
Wolfgang


More information about the Haskell-prime mailing list