Seems like a good time to mention the Maybe monad looks like it would be a good fit here.<br><br>score :: String -&gt; String -&gt; Maybe String<br>score s [] = Nothing<br>score s g =<br>    if valid 4 g<br>    then let s1 = &quot;Golds &quot;<br>
        s2 = show (gold s g)<br>        s3 = &quot;, Silvers &quot;<br>        s4 = show (silver s g)<br>        in Just (s1 ++ s2 ++ s3 ++ s4)<br>    else Just &quot;Bad Guess&quot;<br><br clear="all">-R. Kyle Murphy<br>
--<br>Curiosity was framed, Ignorance killed the cat.<br>
<br><br><div class="gmail_quote">On Tue, Mar 9, 2010 at 17:42, Brent Yorgey <span dir="ltr">&lt;<a href="mailto:byorgey@seas.upenn.edu">byorgey@seas.upenn.edu</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;">
<div class="im">On Tue, Mar 09, 2010 at 08:42:44PM +0100, Sebastian Hungerecker wrote:<br>
&gt; On 09.03.2010 20:04, boblettoj wrote:<br>
&gt;&gt; score :: String -&gt;  String -&gt;  String<br>
&gt;&gt; score [s] [] = false<br>
&gt;&gt; score [s] [g] =<br>
&gt;&gt;      if valid 4 g<br>
&gt;&gt;      then (s1 ++ s2 ++ s3 ++ s4) where<br>
&gt;&gt;              s1 = &quot;Golds &quot;<br>
&gt;&gt;              s2 = show (gold s g)<br>
&gt;&gt;              s3 = &quot;, Silvers &quot;<br>
&gt;&gt;              s4 = show (silver s g)<br>
&gt;&gt;      else &quot;Bad Guess&quot;<br>
&gt;&gt;<br>
&gt;<br>
&gt; Apart from the parse error there is also a type error<br>
&gt; in your code:<br>
&gt; When the second argument is empty, you return false<br>
&gt; although you declared the function to return a String,<br>
&gt; not a boolean.<br>
<br>
</div>Not quite; data Bool = True | False, and the code uses a lowercase &#39;f&#39;<br>
&#39;false&#39;. Perhaps &#39;false&#39; is defined as a String somewhere else?  A bit<br>
odd, perhaps, but not necessarily a type error.<br>
<font color="#888888"><br>
-Brent<br>
</font><div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>