Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type OctalNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d)
- type Octal d = (D0 d, OctalNoZero d)
- parseOctalNoZero :: (OctalNoZero d, CharParsing p) => p d
- parseOctal :: (Octal d, CharParsing p) => p d
Documentation
type Octal d = (D0 d, OctalNoZero d) Source #
parseOctalNoZero :: (OctalNoZero d, CharParsing p) => p d Source #
>>>
parse (parseOctalNoZero <* eof) "test" "1" :: Either ParseError Digit
Right 1
>>>
parse parseOctalNoZero "test" "1xyz" :: Either ParseError Digit
Right 1
>>>
parse (parseOctalNoZero <* eof) "test" "2" :: Either ParseError Digit
Right 2
>>>
parse parseOctalNoZero "test" "2xyz" :: Either ParseError Digit
Right 2
>>>
parse (parseOctalNoZero <* eof) "test" "3" :: Either ParseError Digit
Right 3
>>>
parse parseOctalNoZero "test" "3xyz" :: Either ParseError Digit
Right 3
>>>
parse (parseOctalNoZero <* eof) "test" "4" :: Either ParseError Digit
Right 4
>>>
parse parseOctalNoZero "test" "4xyz" :: Either ParseError Digit
Right 4
>>>
parse (parseOctalNoZero <* eof) "test" "5" :: Either ParseError Digit
Right 5
>>>
parse parseOctalNoZero "test" "5xyz" :: Either ParseError Digit
Right 5
>>>
parse (parseOctalNoZero <* eof) "test" "6" :: Either ParseError Digit
Right 6
>>>
parse parseOctalNoZero "test" "6xyz" :: Either ParseError Digit
Right 6
>>>
parse (parseOctalNoZero <* eof) "test" "7" :: Either ParseError Digit
Right 7
>>>
parse parseOctalNoZero "test" "7xyz" :: Either ParseError Digit
Right 7
>>>
isn't _Right (parse parseOctalNoZero "test" "xyz" :: Either ParseError Digit)
True
\c -> (c `notElem` "1234567") ==> isn't _Right (parse parseOctalNoZero "test" [c] :: Either ParseError Digit)
parseOctal :: (Octal d, CharParsing p) => p d Source #
>>>
parse (parseOctal <* eof) "test" "0" :: Either ParseError Digit
Right 0
>>>
parse (parseOctal <* eof) "test" "0" :: Either ParseError Digit
Right 0
>>>
parse parseOctal "test" "1xyz" :: Either ParseError Digit
Right 1
>>>
parse parseOctal "test" "1xyz" :: Either ParseError Digit
Right 1
>>>
parse (parseOctal <* eof) "test" "2" :: Either ParseError Digit
Right 2
>>>
parse parseOctal "test" "2xyz" :: Either ParseError Digit
Right 2
>>>
parse (parseOctal <* eof) "test" "3" :: Either ParseError Digit
Right 3
>>>
parse parseOctal "test" "3xyz" :: Either ParseError Digit
Right 3
>>>
parse (parseOctal <* eof) "test" "4" :: Either ParseError Digit
Right 4
>>>
parse parseOctal "test" "4xyz" :: Either ParseError Digit
Right 4
>>>
parse (parseOctal <* eof) "test" "5" :: Either ParseError Digit
Right 5
>>>
parse parseOctal "test" "5xyz" :: Either ParseError Digit
Right 5
>>>
parse (parseOctal <* eof) "test" "6" :: Either ParseError Digit
Right 6
>>>
parse parseOctal "test" "6xyz" :: Either ParseError Digit
Right 6
>>>
parse (parseOctal <* eof) "test" "7" :: Either ParseError Digit
Right 7
>>>
parse parseOctal "test" "7xyz" :: Either ParseError Digit
Right 7
>>>
isn't _Right (parse parseOctal "test" "xyz" :: Either ParseError Digit)
True
\c -> (c `notElem` "01234567") ==> isn't _Right (parse parseOctal "test" [c] :: Either ParseError Digit)