<p class="western" style="margin-bottom:0cm">Hi.</p>
<p class="western" style="margin-bottom:0cm">I&#39;m Following the book
of Programming in haskell written by Graham Hutton. In Chapter number
8 there is a discussion about functional parsers and it is defined a
functional Parser item and some basic parsers as follow</p>
<p class="western" style="margin-bottom:0cm"><br>
</p>
<p class="western" style="margin-bottom:0cm"><i>success :: a -&gt;
Parser a</i></p>
<p class="western" style="margin-bottom:0cm"><i>success v = \ inp -&gt;
[(v,inp)]</i></p>
<p class="western" style="margin-bottom:0cm"><br>
</p>
<p class="western" style="margin-bottom:0cm"><i>failure :: Parser a</i></p>
<p class="western" style="margin-bottom:0cm"><i>failure = \inp -&gt;
[ ]</i></p>
<p class="western" style="margin-bottom:0cm"><br>
</p>
<p class="western" style="margin-bottom:0cm"><i>item :: Parser Char</i></p>
<p class="western" style="margin-bottom:0cm"><i>item = \inp -&gt;
case inp of</i></p>
<p class="western" style="margin-bottom:0cm">     <i>[ ] -&gt; [ ]</i></p>
<p class="western" style="margin-bottom:0cm">     <i>(x:xs) -&gt;
[(x,xs)]</i></p>
<p class="western" style="margin-bottom:0cm"><br>
</p>
<p class="western" style="margin-bottom:0cm">Based
on this parser it is defined a<i> </i>new
parser called <i>sat p</i> 
</p>
<p class="western" style="margin-bottom:0cm"><i>sat :: (Char -&gt;
Bool ) -&gt; Parser Char</i></p>
<p class="western" style="margin-bottom:0cm"><i>sat p = do x &lt;-
item</i></p>
<p class="western" style="margin-bottom:0cm">           <i>if p x 
then success x else failure</i></p>
<p class="western" style="margin-bottom:0cm"><br>
</p>
<p class="western" style="margin-bottom:0cm">as result, this error appears </p><p class="western" style="margin-bottom:0cm"><br></p>
<p class="western" style="margin-bottom:0cm"><i>Couldn&#39;t match
expected type `Char&#39;</i></p>
<p class="western" style="margin-bottom:0cm">                <i>with
actual type `[(Char, String)]&#39;</i></p>
<p class="western" style="margin-bottom:0cm">    <i>In the first
argument of `p&#39;, namely `x&#39;</i></p>
<p class="western" style="margin-bottom:0cm">    <i>In the
expression: p x</i></p>
<p class="western" style="margin-bottom:0cm">    <i>In the
expression: if p x then success x else failure</i></p>
<p class="western" style="margin-bottom:0cm"><br>
</p>
<p class="western" style="margin-bottom:0cm">Can
you help me ?</p>
<p class="western" style="margin-bottom:0cm">Greets,</p>
<p class="western" style="margin-bottom:0cm">Felipe</p>