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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D1

Synopsis

Documentation

class D1 d where Source #

Minimal complete definition

d1

Methods

d1 :: Prism' d () Source #

x1 :: d Source #

Instances

D1 () Source # 

Methods

d1 :: Prism' () () Source #

x1 :: () Source #

D1 a => D1 (Digit1 a) Source # 

Methods

d1 :: Prism' (Digit1 a) () Source #

x1 :: Digit1 a Source #

D1 d => D1 (Either d x) Source # 

Methods

d1 :: Prism' (Either d x) () Source #

x1 :: Either d x Source #

parse1 :: (D1 d, CharParsing p) => p d Source #

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