
23 Feb
2011
23 Feb
'11
12:30 a.m.
I'm working through the "Write Yourself a Scheme" wikibook and having trouble with one of the exercises. For the function parseNumber :: Parser LispVal, both parseNumber = liftM (Number . read) $ many1 digit parseNumber' = do digits <- many1 digit return $ (Number . read) digits work. But parseNumber'' = many1 digit >>= liftM read >>= liftM Number complains "couldn't match expected type Char against inferred type [Char]". Is liftM engaging the list monad? How do I fix this?