<div dir="ltr"><div class="gmail_extra">Your questions aren't lame. They are common confusions from those who come from a not-so-mathy background.<br><br>Your first question:<br><br>    Shouldn't the return type be of (Char, [Char])? <br><br>suggests that you're confusing the type synonym of (Parser a), which is String -> (a, String), with just the right-hand-side, (a, String).<br><br>Your "z" expression has type Parser ([Char], Char), which means the same thing as String -> ((String, Char), String).<br><br>How did that happen?<br><br>Because<br><br>    item `bind` (\x -> (\y -> result (x,y))) "Rohit"<br><br>is equivalent to<br><br>    item `bind` ( (\x -> (\y -> result (x,y))) "Rohit" )<br><br>as those last two expressions go together by the parsing rules.<br><br>So what you actually have is<br><br>    item `bind` (\y -> result ("Rohit",y))<br><br>The first argument to bind has type Parser Char, the second argument (a -> Parser (String,a)).<br><br>The result is exactly what's expected: Parser (String, Char), i.e. String -> ((String, Char), String).<br><br>p.s. This might be what you're looking for: Try evaluating<br><br>   item "Rohit"<br><br>in the repl. <br><br><br clear="all"><div><div class="gmail_signature">-- Kim-Ee</div></div>
</div></div>