From 3285ad9d62303fcdfa099b2bc3b949a198e9b2b5 Mon Sep 17 00:00:00 2001 From: Tommy Date: Sun, 22 Sep 2019 16:50:28 -0400 Subject: [PATCH] Small change in token parser. I'm new to haskell and following this article/tutorial/book. It's very nice thanks for making it! In my version, adding this change makes sense to me and allows expressions like ```4 * 12``` where the current version only allows ```4* 12``` and ```4*12``` which I find a little strange. --- chapter3/parsec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter3/parsec.hs b/chapter3/parsec.hs index 958629e..d6ef6bf 100644 --- a/chapter3/parsec.hs +++ b/chapter3/parsec.hs @@ -92,7 +92,7 @@ string [] = return [] string (c:cs) = do { char c; string cs; return (c:cs)} token :: Parser a -> Parser a -token p = do { a <- p; spaces ; return a} +token p = do { spaces; a <- p; spaces; return a} reserved :: String -> Parser String reserved s = token (string s)