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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D3

Synopsis

Documentation

class D3 d where Source #

Minimal complete definition

d3

Methods

d3 :: Prism' d () Source #

x3 :: d Source #

Instances

D3 () Source # 

Methods

d3 :: Prism' () () Source #

x3 :: () Source #

D3 a => D3 (Digit3 a) Source # 

Methods

d3 :: Prism' (Digit3 a) () Source #

x3 :: Digit3 a Source #

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

Methods

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

x3 :: Either d x Source #

parse3 :: (D3 d, CharParsing p) => p d Source #

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