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