<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>Hey,<br>
<br>
can you show us your Parser definition? <br>
<br>
Cheers,<br>
Tobias <br>
<br>
----- Nachricht von Marcus Manning <<a href="mailto:iconsize@gmail.com">iconsize@gmail.com</a>> ---------<br>
Datum: Sun, 5 Nov 2017 18:51:57 +0100<br>
Von: Marcus Manning <<a href="mailto:iconsize@gmail.com">iconsize@gmail.com</a>><br>
Antwort an: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <<a href="mailto:beginners@haskell.org">beginners@haskell.org</a>><br>
Betreff: [Haskell-beginners] Could not get parser ready<br>
An: <a href="mailto:beginners@haskell.org">beginners@haskell.org</a></p>
<blockquote style="border-left:2px solid blue;margin-left:2px;padding-left:12px;" type="cite">
<p>Hello,<br>
<br>
I follow the instructions of script [1] in order to set up a parser functionality. But I' get into problems at page 202 with the code:<br>
<br>
p :: Parser (Char,Char)<br>
p = do<br>
x ← item<br>
item<br>
y ← item<br>
return (x,y)<br>
<br>
<br>
ghci and ghc throw errors:<br>
Prelude> let p:: Parser (Char,Char); p = do {x <- item; item; y <- item; return (x,y)}<br>
<br>
<interactive>:10:65: error:<br>
• Couldn't match type ‘[(Char, String)]’ with ‘Char’<br>
Expected type: String -> [((Char, Char), String)]<br>
Actual type: Parser ([(Char, String)], [(Char, String)])<br>
• In a stmt of a 'do' block: return (x, y)<br>
In the expression:<br>
do x <- item<br>
item<br>
y <- item<br>
return (x, y)<br>
In an equation for ‘p’:<br>
p = do x <- item<br>
item<br>
y <- item<br>
....<br>
Did the semantics of do expr changed?<br>
<br>
[1] <a href="https://userpages.uni-koblenz.de/~laemmel/paradigms1011/resources/pdf/haskell.pdf" target="_blank">https://userpages.uni-koblenz.de/~laemmel/paradigms1011/resources/pdf/haskell.pdf</a><br>
<br>
Cheers,<br>
<br>
iconfly.<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell">Beginners@haskell</a>.<a href="orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a></p>
</blockquote>
<p><br>
<br>
<br>
----- Ende der Nachricht von Marcus Manning <<a href="mailto:iconsize@gmail.com">iconsize@gmail.com</a>> -----<br>
<br></p>
</body>
</html>