Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class D1 d where
- parse1 :: (D1 d, CharParsing p) => p d
Documentation
parse1 :: (D1 d, CharParsing p) => p d Source #
>>>
parse (parse1 <* eof) "test" "1" :: Either ParseError Digit
Right 1
>>>
parse parse1 "test" "1xyz" :: Either ParseError Digit
Right 1
>>>
isn't _Right (parse parse1 "test" "xyz" :: Either ParseError Digit)
True
\c -> c /= '1' ==> isn't _Right (parse parse1 "test" [c] :: Either ParseError Digit)