Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Type errors with Parsec
  2. import Text.ParserCombinators.Parsec hiding (many, optional, (<|>))
  3. import Text.ParserCombinators.Parsec.Char
  4. import Text.Parsec.String
  5. import Control.Applicative
  6. p_int = many char ' ' *> many1 digit <* many char ' '
  7.        
  8. Couldn't match expected type `[Char]'
  9.             with actual type `Text.Parsec.Prim.ParsecT s0 u0 m0 [a0]'
  10. In the return type of a call of `many1'
  11. In the second argument of `(*>)', namely `many1 digit'
  12. In the first argument of `(<*)', namely
  13.   `many char ' ' *> many1 digit'
  14.        
  15. many char ' '
  16.        
  17. many (char ' ')