class Enum a where
...
-- | Used in Haskell's translation of [n,n'..m].
enumFromThenTo :: a -> a -> a -> [a]
So [x, y .. z] becomes "enumFromThenTo x y z".
Each instance of Enum is free to implement enumFromThenTo and friends
in any way it likes.
So with Ints you have [1, 3 .. 10] :: [Int]
At 12:28 07/04/2008, you wrote:
On Fri, Apr 4, 2008 at 10:49 PM, Andrew Coppin
<[EMAIL PROTECTED]> wrote:
> More to the point, the range y..z goes in steps of y-z. ;-)
[x,y..z] goes in steps of y-x ;-), [y..z] goes in steps of 1
(depending on the type).
Could you elaborate please?
On Fri, Apr 4, 2008 at 10:49 PM, Andrew Coppin
<[EMAIL PROTECTED]> wrote:
> More to the point, the range y..z goes in steps of y-z. ;-)
[x,y..z] goes in steps of y-x ;-), [y..z] goes in steps of 1
(depending on the type).
___
Haskell-Cafe mailing list
Ha
Stefan O'Rear wrote:
On Fri, Apr 04, 2008 at 08:58:06PM +0100, PR Stanley wrote:
Hi folks
[x, y..z]
What's the role of x?
Cheers,
Paul
First number in the output; also all pairs differ as much as the first
two numbers do.
Try e.g [1, 2 .. 10] and [0, 2 .. 10]
More to the point, t
On Fri, Apr 04, 2008 at 08:58:06PM +0100, PR Stanley wrote:
> [x, y..z]
> What's the role of x?
It's the first argument passed to enumFromThenTo.
See sections 3.10 and 6.3.4 of the Haskell report.
Ciao,
Kili
--
There's a limit to how many buttons a shirt should have.
--
On Fri, Apr 04, 2008 at 08:58:06PM +0100, PR Stanley wrote:
> Hi folks
> [x, y..z]
> What's the role of x?
> Cheers,
> Paul
First number in the output; also all pairs differ as much as the first
two numbers do.
Try e.g [1, 2 .. 10] and [0, 2 .. 10]
Stefan
signature.asc
Description: Digital sig
Hi folks
[x, y..z]
What's the role of x?
Cheers,
Paul
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe