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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D5

Synopsis

Documentation

class D5 d where Source #

Minimal complete definition

d5

Methods

d5 :: Prism' d () Source #

x5 :: d Source #

Instances

D5 () Source # 

Methods

d5 :: Prism' () () Source #

x5 :: () Source #

D5 Digit Source # 

Methods

d5 :: Prism' Digit () Source #

x5 :: Digit Source #

parse5 :: (D5 d, CharParsing p) => p d Source #

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