digit-0.5.2: A data-type representing digits 0-9 and other combinations

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D0

Synopsis

Documentation

class D0 d where Source #

Minimal complete definition

d0

Methods

d0 :: Prism' d () Source #

x0 :: d Source #

Instances

D0 () Source # 

Methods

d0 :: Prism' () () Source #

x0 :: () Source #

D0 Digit Source # 

Methods

d0 :: Prism' Digit () Source #

x0 :: Digit Source #

parse0 :: (D0 d, CharParsing p) => p d Source #

>>> parse (parse0 <* eof) "test" "0" :: Either ParseError Digit
Right 0
>>> parse parse0 "test" "0xyz" :: Either ParseError Digit
Right 0
>>> isn't _Right (parse parse0 "test" "xyz" :: Either ParseError Digit)
True
\c -> c /= '0' ==> isn't _Right (parse parse0 "test" [c] :: Either ParseError Digit)