<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I didn't know that, but there's a lot I don't know about Haskell.<br><br>It works great.<br><br>Thanks!<br><br>Michael<br><br>--- On <b>Tue, 4/14/09, John Dorsey <i><haskell@colquitt.org></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: John Dorsey <haskell@colquitt.org><br>Subject: Re: [Haskell-cafe] Printing list of enum type<br>To: "michael rice" <nowgate@yahoo.com><br>Cc: haskell-cafe@haskell.org<br>Date: Tuesday, April 14, 2009, 3:33 PM<br><br><div class="plainMail">Michael,<br><br>> What do I need to add to this Color enum type to print a list of them?<br><br>You can also easily print a list of /all/ of them.<br><br>Regards,<br>John<br><br>scratch$ cat color.hs <br><br>data Color<br> = Red<br> | Blue<br> |
Green<br> | Yellow<br> | Orange<br> | Brown<br> | White<br> | Black<br> deriving (Show,Enum,Bounded)<br><br>scratch$ ghci color.hs <br>*Main> [minBound..maxBound] :: [Color]<br>[Red,Blue,Green,Yellow,Orange,Brown,White,Black]<br><br></div></blockquote></td></tr></table><br>