Wolfgang Jeltsch [EMAIL PROTECTED] writes:
Also, toEnum and fromEnum would make more sense mapping from and to
Integer.
Why do we need toEnum and fromEnum at all? As far as I know, they are merely
there to help people implement things like enumFrom.
They are often useful for writing
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
Am Dienstag, 21. März 2006 10:08 schrieb Malcolm Wallace:
Wolfgang Jeltsch [EMAIL PROTECTED] writes:
[...]
Why do we need toEnum and fromEnum at all? As far as I know, they are
merely there to help people implement things like enumFrom.
They are often useful for writing serialisation
Am Freitag, 17. März 2006 18:49 schrieb Ross Paterson:
[...]
Also, toEnum and fromEnum would make more sense mapping from and to
Integer.
Why do we need toEnum and fromEnum at all? As far as I know, they are merely
there to help people implement things like enumFrom. It's often not clear
On 2006-03-20, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
Am Freitag, 17. März 2006 18:49 schrieb Ross Paterson:
[...]
Also, toEnum and fromEnum would make more sense mapping from and to
Integer.
Why do we need toEnum and fromEnum at all? As far as I know, they are merely
there to help
On 2006-03-18, Jim Apple [EMAIL PROTECTED] wrote:
On 3/18/06, Aaron Denney [EMAIL PROTECTED] wrote:
Rational _could_ be added here by the diagonal representation, but
probably sohuldn't.
We could also add an actual enumeration of rationals, as in
On 2006-03-18, Aaron Denney [EMAIL PROTECTED] wrote:
class ArithmeticSequence a where
stepFrom :: a - [a]-- [n..]
stepFromBy:: a - a - [a] -- [n,n'..]
stepFromTo:: a - a - [a] -- [n..m]
stepFromByTo :: a - a - a - [a] -- [n,n'..m]
On Fri, Mar 17, 2006 at 04:48:52PM +, Aaron Denney wrote:
Sometime back on one of the other Haskell lists, there was a proposal
to not have the floating types instances of Enum and instead have some
other class to which [a, b..c] desugars. That is, rename enumFromThen
and friends and put
On 2006-03-17, Ross Paterson wrote:
Speaking of confusing, try
[0, 0.3 .. 2]::[Rational]
Right. I had forgotten that -- Rational is exact, yet has the weird
closest endpoint behavior of Float and Double.
Also, toEnum and fromEnum would make more sense mapping from and to
Integer. It