> enumerate :: (Enum a, Bounded a) => [a]
> enumerate = [minBound .. maxBound]
> 
> data Test = Foo | Bar | Blah | Nonsense
>             deriving (Show, Enum, Bounded)
> 
> main = print (enumerate :: [Test])
> BASH.EXE-2.02$ ghc-4.03 -static Enum.o
> BASH.EXE-2.02$ ./a.exe
> [Foo,Foo,Foo,Foo]

To be a tad more specific, the problem is the derived toEnum,
which defines toEnum 0 = Foo, toEnum 1 = Foo ...

Cheers,
Alex.

Reply via email to