
14 Apr
2009
14 Apr
'09
3:33 p.m.
Michael,
What do I need to add to this Color enum type to print a list of them?
You can also easily print a list of /all/ of them. Regards, John scratch$ cat color.hs data Color = Red | Blue | Green | Yellow | Orange | Brown | White | Black deriving (Show,Enum,Bounded) scratch$ ghci color.hs *Main> [minBound..maxBound] :: [Color] [Red,Blue,Green,Yellow,Orange,Brown,White,Black]