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 href="mailto:nowgate@yahoo.com">nowgate@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">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 href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>