<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dumb, dumb, dumb, dumb, DUMB!, he Lisped.<br><br>Thanks.<br><br>Michael<br><br>--- On <b>Tue, 4/14/09, Andrew Wagner <i><wagner.andrew@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Andrew Wagner <wagner.andrew@gmail.com><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, 9:19 AM<br><br><div id="yiv953747372">You don't need to add anything, you just need to use list notation correctly. Try typing [Red, Black, White] in at the prompt instead. The commas are part of the list syntax.<br><br><div class="gmail_quote">On Tue, Apr 14, 2009 at 9:15 AM, michael rice <span dir="ltr"><<a rel="nofollow" ymailto="mailto:nowgate@yahoo.com"
target="_blank" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;" valign="top">What do I need to add to this Color enum type to print a list of them?<br>
<br>Michael<br><br>===============<br><br>
data Color<br>
= Red<br>
| Blue<br>
| Green<br>
| Yellow<br>
| Orange<br>
| Brown<br>
| White<br>
| Black<br>
<br>
instance Show Color where<br>
show Red = "Red"<br>
show Blue = "Blue"<br>
show Green = "Green"<br>
show Yellow = "Yellow"<br>
show Orange = "Orange"<br>
show Brown = "Brown"<br>
show White = "White"<br>
show Black = "Black"<br><br>======================<br><br>
Ok, modules loaded: Main.<br>*Main> Red<br>Red<br>*Main> Black<br>Black<br>*Main> [Red Black White]<br><br><interactive>:1:1:<br> Couldn't match expected type `Color -> Color -> t'<br> against inferred type `Color'<br>
In the expression: Red Black White<br> In the expression: [Red Black White]<br> In the definition of `it': it = [Red Black White]<br><br><br><br><br><br></td></tr></tbody></table><br>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a rel="nofollow" ymailto="mailto:Haskell-Cafe@haskell.org" target="_blank" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a rel="nofollow" target="_blank" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>
</div></blockquote></td></tr></table><br>