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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.Class.D2

Synopsis

Documentation

class D2 d where Source #

Minimal complete definition

d2

Methods

d2 :: Prism' d () Source #

x2 :: d Source #

Instances
D2 () Source # 
Instance details

Defined in Data.Digit.Class.D2

Methods

d2 :: Prism' () () Source #

x2 :: () Source #

D2 DecDigit Source # 
Instance details

Defined in Data.Digit.Decimal

D2 HexDigit Source # 
Instance details

Defined in Data.Digit.Hexadecimal.LowerCase

D2 HeXDigit Source # 
Instance details

Defined in Data.Digit.Hexadecimal.MixedCase

D2 HEXDigit Source # 
Instance details

Defined in Data.Digit.Hexadecimal.UpperCase

D2 OctDigit Source # 
Instance details

Defined in Data.Digit.Octal

parse2 :: (D2 d, CharParsing p) => p d Source #

>>> parse (parse2 <* eof) "test" "2" :: Either ParseError DecDigit
Right DecDigit2
>>> parse parse2 "test" "2xyz" :: Either ParseError DecDigit
Right DecDigit2
>>> isn't _Right (parse parse2 "test" "xyz" :: Either ParseError DecDigit)
True