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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D8

Synopsis

Documentation

class D8 d where Source #

Minimal complete definition

d8

Methods

d8 :: Prism' d () Source #

x8 :: d Source #

Instances

D8 () Source # 

Methods

d8 :: Prism' () () Source #

x8 :: () Source #

D8 Digit Source # 

Methods

d8 :: Prism' Digit () Source #

x8 :: Digit Source #

parse8 :: (D8 d, CharParsing p) => p d Source #

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