| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Data.Digit.Decimal
- type DecimalNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d, D8 d, D9 d)
 - type Decimal d = (D0 d, DecimalNoZero d)
 - parseDecimalNoZero :: (DecimalNoZero d, CharParsing p) => p d
 - parseDecimal :: (Decimal d, CharParsing p) => p d
 
Documentation
type Decimal d = (D0 d, DecimalNoZero d) Source #
parseDecimalNoZero :: (DecimalNoZero d, CharParsing p) => p d Source #
>>>parse (parseDecimalNoZero <* eof) "test" "1" :: Either ParseError DigitRight 1
>>>parse parseDecimalNoZero "test" "1xyz" :: Either ParseError DigitRight 1
>>>parse (parseDecimalNoZero <* eof) "test" "2" :: Either ParseError DigitRight 2
>>>parse parseDecimalNoZero "test" "2xyz" :: Either ParseError DigitRight 2
>>>parse (parseDecimalNoZero <* eof) "test" "3" :: Either ParseError DigitRight 3
>>>parse parseDecimalNoZero "test" "3xyz" :: Either ParseError DigitRight 3
>>>parse (parseDecimalNoZero <* eof) "test" "4" :: Either ParseError DigitRight 4
>>>parse parseDecimalNoZero "test" "4xyz" :: Either ParseError DigitRight 4
>>>parse (parseDecimalNoZero <* eof) "test" "5" :: Either ParseError DigitRight 5
>>>parse parseDecimalNoZero "test" "5xyz" :: Either ParseError DigitRight 5
>>>parse (parseDecimalNoZero <* eof) "test" "6" :: Either ParseError DigitRight 6
>>>parse parseDecimalNoZero "test" "6xyz" :: Either ParseError DigitRight 6
>>>parse (parseDecimalNoZero <* eof) "test" "7" :: Either ParseError DigitRight 7
>>>parse parseDecimalNoZero "test" "7xyz" :: Either ParseError DigitRight 7
>>>parse (parseDecimalNoZero <* eof) "test" "8" :: Either ParseError DigitRight 8
>>>parse parseDecimalNoZero "test" "8xyz" :: Either ParseError DigitRight 8
>>>parse (parseDecimalNoZero <* eof) "test" "9" :: Either ParseError DigitRight 9
>>>parse parseDecimalNoZero "test" "9xyz" :: Either ParseError DigitRight 9
>>>isn't _Right (parse parseDecimalNoZero "test" "xyz" :: Either ParseError Digit)True
\c -> (c `notElem` "123456789") ==> isn't _Right (parse parseDecimalNoZero "test" [c] :: Either ParseError Digit)
parseDecimal :: (Decimal d, CharParsing p) => p d Source #
>>>parse (parseDecimal <* eof) "test" "0" :: Either ParseError DigitRight 0
>>>parse parseDecimal "test" "0xyz" :: Either ParseError DigitRight 0
>>>parse (parseDecimal <* eof) "test" "1" :: Either ParseError DigitRight 1
>>>parse parseDecimal "test" "1xyz" :: Either ParseError DigitRight 1
>>>parse (parseDecimal <* eof) "test" "2" :: Either ParseError DigitRight 2
>>>parse parseDecimal "test" "2xyz" :: Either ParseError DigitRight 2
>>>parse (parseDecimal <* eof) "test" "3" :: Either ParseError DigitRight 3
>>>parse parseDecimal "test" "3xyz" :: Either ParseError DigitRight 3
>>>parse (parseDecimal <* eof) "test" "4" :: Either ParseError DigitRight 4
>>>parse parseDecimal "test" "4xyz" :: Either ParseError DigitRight 4
>>>parse (parseDecimal <* eof) "test" "5" :: Either ParseError DigitRight 5
>>>parse parseDecimal "test" "5xyz" :: Either ParseError DigitRight 5
>>>parse (parseDecimal <* eof) "test" "6" :: Either ParseError DigitRight 6
>>>parse parseDecimal "test" "6xyz" :: Either ParseError DigitRight 6
>>>parse (parseDecimal <* eof) "test" "7" :: Either ParseError DigitRight 7
>>>parse parseDecimal "test" "7xyz" :: Either ParseError DigitRight 7
>>>parse (parseDecimal <* eof) "test" "8" :: Either ParseError DigitRight 8
>>>parse parseDecimal "test" "8xyz" :: Either ParseError DigitRight 8
>>>parse (parseDecimal <* eof) "test" "9" :: Either ParseError DigitRight 9
>>>parse parseDecimal "test" "9xyz" :: Either ParseError DigitRight 9
>>>isn't _Right (parse parseDecimal "test" "xyz" :: Either ParseError Digit)True
\c -> (c `notElem` "0123456789") ==> isn't _Right (parse parseDecimal "test" [c] :: Either ParseError Digit)