<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>&lt;wagner.andrew@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Andrew Wagner &lt;wagner.andrew@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] Printing list of enum type<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<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&nbsp;[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">&lt;<a rel="nofollow" ymailto="mailto:nowgate@yahoo.com"
 target="_blank" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;</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>
&nbsp;&nbsp;&nbsp; = Red<br>
&nbsp;&nbsp;&nbsp; | Blue<br>
&nbsp;&nbsp;&nbsp; | Green<br>
&nbsp;&nbsp;&nbsp; | Yellow<br>
&nbsp;&nbsp;&nbsp; | Orange<br>
&nbsp;&nbsp;&nbsp; | Brown<br>
&nbsp;&nbsp;&nbsp; | White<br>
&nbsp;&nbsp;&nbsp; | Black<br>
<br>
instance Show Color where<br>
&nbsp;&nbsp;&nbsp; show Red&nbsp;&nbsp; = "Red"<br>
&nbsp;&nbsp;&nbsp; show Blue&nbsp; = "Blue"<br>
&nbsp;&nbsp;&nbsp; show Green = "Green"<br>
&nbsp;&nbsp;&nbsp; show Yellow = "Yellow"<br>
&nbsp;&nbsp;&nbsp; show Orange = "Orange"<br>
&nbsp;&nbsp;&nbsp; show Brown = "Brown"<br>
&nbsp;&nbsp;&nbsp; show White = "White"<br>
&nbsp;&nbsp;&nbsp; show Black = "Black"<br><br>======================<br><br>
Ok, modules loaded: Main.<br>*Main&gt; Red<br>Red<br>*Main&gt; Black<br>Black<br>*Main&gt; [Red Black White]<br><br>&lt;interactive&gt;:1:1:<br>&nbsp;&nbsp;&nbsp; Couldn't match expected type `Color -&gt; Color -&gt; t'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; against inferred type `Color'<br>
&nbsp;&nbsp;&nbsp; In the expression: Red Black White<br>&nbsp;&nbsp;&nbsp; In the expression: [Red Black White]<br>&nbsp;&nbsp;&nbsp; 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>