[Haskell-beginners] Parsec 3.0 problems
iand675 at gmail.com
Mon Apr 20 19:26:35 EDT 2009
I have the simple applicative parser combinator:
parseLabel = Label <$> (between spaces (char ':') (many1 alphaNum))
This gives me the error:
No instance for (Stream s m Char)
arising from a use of `spaces' at tree.hs:18:32-37
Possible fix: add an instance declaration for (Stream s m Char)
In the first argument of `between', namely `spaces'
In the second argument of `(<$>)', namely
`(between spaces (char ':') (many1 alphaNum))'
In the expression:
Label <$> (between spaces (char ':') (many1 alphaNum))
When I test this function in ghci, I have no problems, yet whenever I try to
open it in a file it fails. What am I doing wrong?
For those who are curious, Label is a data constructor in the following data
data Loc = Label String
| Addr Int
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners