-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A data-type representing digits 0-9 and other combinations -- -- -- Digit is a data-type that represents the digits 0-9 and other -- combinations. @package digit @version 0.5.2 module Data.Digit.Digit data Digit Digit0 :: Digit Digit1 :: Digit Digit2 :: Digit Digit3 :: Digit Digit4 :: Digit Digit5 :: Digit Digit6 :: Digit Digit7 :: Digit Digit8 :: Digit Digit9 :: Digit Digita :: Digit Digitb :: Digit Digitc :: Digit Digitd :: Digit Digite :: Digit Digitf :: Digit DigitA :: Digit DigitB :: Digit DigitC :: Digit DigitD :: Digit DigitE :: Digit DigitF :: Digit instance GHC.Classes.Ord Data.Digit.Digit.Digit instance GHC.Classes.Eq Data.Digit.Digit.Digit instance GHC.Show.Show Data.Digit.Digit.Digit module Data.Digit.Df class Df d df :: Df d => Prism' d () xf :: Df d => d -- |
-- >>> parse (parsef <* eof) "test" "f" :: Either ParseError Digit -- Right f ---- --
-- >>> parse parsef "test" "fxyz" :: Either ParseError Digit -- Right f ---- --
-- >>> isn't _Right (parse parsef "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'f' ==> isn't _Right (parse parsef "test" [c] :: Either ParseError Digit) --parsef :: (Df d, CharParsing p) => p d instance Data.Digit.Df.Df () instance Data.Digit.Df.Df Data.Digit.Digit.Digit module Data.Digit.De class De d de :: De d => Prism' d () xe :: De d => d -- |
-- >>> parse (parsee <* eof) "test" "e" :: Either ParseError Digit -- Right e ---- --
-- >>> parse parsee "test" "exyz" :: Either ParseError Digit -- Right e ---- --
-- >>> isn't _Right (parse parsee "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'e' ==> isn't _Right (parse parsee "test" [c] :: Either ParseError Digit) --parsee :: (De d, CharParsing p) => p d instance Data.Digit.De.De () instance Data.Digit.De.De Data.Digit.Digit.Digit module Data.Digit.Dd class Dd d dd :: Dd d => Prism' d () xd :: Dd d => d -- |
-- >>> parse (parsed <* eof) "test" "d" :: Either ParseError Digit -- Right d ---- --
-- >>> parse parsed "test" "dxyz" :: Either ParseError Digit -- Right d ---- --
-- >>> isn't _Right (parse parsed "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'd' ==> isn't _Right (parse parsed "test" [c] :: Either ParseError Digit) --parsed :: (Dd d, CharParsing p) => p d instance Data.Digit.Dd.Dd () instance Data.Digit.Dd.Dd Data.Digit.Digit.Digit module Data.Digit.Dc class Dc d dc :: Dc d => Prism' d () xc :: Dc d => d -- |
-- >>> parse (parsec <* eof) "test" "c" :: Either ParseError Digit -- Right c ---- --
-- >>> parse parsec "test" "cxyz" :: Either ParseError Digit -- Right c ---- --
-- >>> isn't _Right (parse parsec "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'c' ==> isn't _Right (parse parsec "test" [c] :: Either ParseError Digit) --parsec :: (Dc d, CharParsing p) => p d instance Data.Digit.Dc.Dc () instance Data.Digit.Dc.Dc Data.Digit.Digit.Digit module Data.Digit.Db class Db d db :: Db d => Prism' d () xb :: Db d => d -- |
-- >>> parse (parseb <* eof) "test" "b" :: Either ParseError Digit -- Right b ---- --
-- >>> parse parseb "test" "bxyz" :: Either ParseError Digit -- Right b ---- --
-- >>> isn't _Right (parse parseb "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'b' ==> isn't _Right (parse parseb "test" [c] :: Either ParseError Digit) --parseb :: (Db d, CharParsing p) => p d instance Data.Digit.Db.Db () instance Data.Digit.Db.Db Data.Digit.Digit.Digit module Data.Digit.Da class Da d da :: Da d => Prism' d () xa :: Da d => d -- |
-- >>> parse (parsea <* eof) "test" "a" :: Either ParseError Digit -- Right a ---- --
-- >>> parse parsea "test" "axyz" :: Either ParseError Digit -- Right a ---- --
-- >>> isn't _Right (parse parsea "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'a' ==> isn't _Right (parse parsea "test" [c] :: Either ParseError Digit) --parsea :: (Da d, CharParsing p) => p d instance Data.Digit.Da.Da () instance Data.Digit.Da.Da Data.Digit.Digit.Digit module Data.Digit.DF class DF d dF :: DF d => Prism' d () xF :: DF d => d -- |
-- >>> parse (parseF <* eof) "test" "F" :: Either ParseError Digit -- Right F ---- --
-- >>> parse parseF "test" "Fxyz" :: Either ParseError Digit -- Right F ---- --
-- >>> isn't _Right (parse parseF "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'F' ==> isn't _Right (parse parseF "test" [c] :: Either ParseError Digit) --parseF :: (DF d, CharParsing p) => p d instance Data.Digit.DF.DF () instance Data.Digit.DF.DF Data.Digit.Digit.Digit module Data.Digit.DFf type DFf a = (DF a, Df a) -- |
-- >>> parse (parseFf <* eof) "test" "F" :: Either ParseError Digit -- Right F ---- --
-- >>> parse parseFf "test" "Fxyz" :: Either ParseError Digit -- Right F ---- --
-- >>> parse (parseFf <* eof) "test" "f" :: Either ParseError Digit -- Right f ---- --
-- >>> parse parseFf "test" "fxyz" :: Either ParseError Digit -- Right f ---- --
-- >>> isn't _Right (parse parseFf "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "Ff") ==> isn't _Right (parse parseFf "test" [c] :: Either ParseError Digit) --parseFf :: (DFf d, CharParsing p) => p d module Data.Digit.DE class DE d dE :: DE d => Prism' d () xE :: DE d => d -- |
-- >>> parse (parseE <* eof) "test" "E" :: Either ParseError Digit -- Right E ---- --
-- >>> parse parseE "test" "Exyz" :: Either ParseError Digit -- Right E ---- --
-- >>> isn't _Right (parse parseE "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'E' ==> isn't _Right (parse parseE "test" [c] :: Either ParseError Digit) --parseE :: (DE d, CharParsing p) => p d instance Data.Digit.DE.DE () instance Data.Digit.DE.DE Data.Digit.Digit.Digit module Data.Digit.DEe type DEe a = (DE a, De a) -- |
-- >>> parse (parseEe <* eof) "test" "E" :: Either ParseError Digit -- Right E ---- --
-- >>> parse parseEe "test" "Exyz" :: Either ParseError Digit -- Right E ---- --
-- >>> parse (parseEe <* eof) "test" "e" :: Either ParseError Digit -- Right e ---- --
-- >>> parse parseEe "test" "exyz" :: Either ParseError Digit -- Right e ---- --
-- >>> isn't _Right (parse parseEe "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "Ee") ==> isn't _Right (parse parseEe "test" [c] :: Either ParseError Digit) --parseEe :: (DEe d, CharParsing p) => p d module Data.Digit.DD class DD d dD :: DD d => Prism' d () xD :: DD d => d -- |
-- >>> parse (parseD <* eof) "test" "D" :: Either ParseError Digit -- Right D ---- --
-- >>> parse parseD "test" "Dxyz" :: Either ParseError Digit -- Right D ---- --
-- >>> isn't _Right (parse parseD "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'D' ==> isn't _Right (parse parseD "test" [c] :: Either ParseError Digit) --parseD :: (DD d, CharParsing p) => p d instance Data.Digit.DD.DD () instance Data.Digit.DD.DD Data.Digit.Digit.Digit module Data.Digit.DDd type DDd a = (DD a, Dd a) -- |
-- >>> parse (parseDd <* eof) "test" "D" :: Either ParseError Digit -- Right D ---- --
-- >>> parse parseDd "test" "Dxyz" :: Either ParseError Digit -- Right D ---- --
-- >>> parse (parseDd <* eof) "test" "d" :: Either ParseError Digit -- Right d ---- --
-- >>> parse parseDd "test" "dxyz" :: Either ParseError Digit -- Right d ---- --
-- >>> isn't _Right (parse parseDd "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "Dd") ==> isn't _Right (parse parseDd "test" [c] :: Either ParseError Digit) --parseDd :: (DDd d, CharParsing p) => p d module Data.Digit.DC class DC d dC :: DC d => Prism' d () xC :: DC d => d -- |
-- >>> parse (parseC <* eof) "test" "C" :: Either ParseError Digit -- Right C ---- --
-- >>> parse parseC "test" "Cxyz" :: Either ParseError Digit -- Right C ---- --
-- >>> isn't _Right (parse parseC "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'C' ==> isn't _Right (parse parseC "test" [c] :: Either ParseError Digit) --parseC :: (DC d, CharParsing p) => p d instance Data.Digit.DC.DC () instance Data.Digit.DC.DC Data.Digit.Digit.Digit module Data.Digit.DCc type DCc a = (DC a, Dc a) -- |
-- >>> parse (parseCc <* eof) "test" "C" :: Either ParseError Digit -- Right C ---- --
-- >>> parse parseCc "test" "Cxyz" :: Either ParseError Digit -- Right C ---- --
-- >>> parse (parseCc <* eof) "test" "c" :: Either ParseError Digit -- Right c ---- --
-- >>> parse parseCc "test" "cxyz" :: Either ParseError Digit -- Right c ---- --
-- >>> isn't _Right (parse parseCc "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "Cc") ==> isn't _Right (parse parseCc "test" [c] :: Either ParseError Digit) --parseCc :: (DCc d, CharParsing p) => p d module Data.Digit.DB class DB d dB :: DB d => Prism' d () xB :: DB d => d -- |
-- >>> parse (parseB <* eof) "test" "B" :: Either ParseError Digit -- Right B ---- --
-- >>> parse parseB "test" "Bxyz" :: Either ParseError Digit -- Right B ---- --
-- >>> isn't _Right (parse parseB "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'B' ==> isn't _Right (parse parseB "test" [c] :: Either ParseError Digit) --parseB :: (DB d, CharParsing p) => p d instance Data.Digit.DB.DB () instance Data.Digit.DB.DB Data.Digit.Digit.Digit module Data.Digit.DBb type DBb a = (DB a, Db a) -- |
-- >>> parse (parseBb <* eof) "test" "B" :: Either ParseError Digit -- Right B ---- --
-- >>> parse parseBb "test" "Bxyz" :: Either ParseError Digit -- Right B ---- --
-- >>> parse (parseBb <* eof) "test" "b" :: Either ParseError Digit -- Right b ---- --
-- >>> parse parseBb "test" "bxyz" :: Either ParseError Digit -- Right b ---- --
-- >>> isn't _Right (parse parseBb "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "Bb") ==> isn't _Right (parse parseBb "test" [c] :: Either ParseError Digit) --parseBb :: (DBb d, CharParsing p) => p d module Data.Digit.DA class DA d dA :: DA d => Prism' d () xA :: DA d => d -- |
-- >>> parse (parseA <* eof) "test" "A" :: Either ParseError Digit -- Right A ---- --
-- >>> parse parseA "test" "Axyz" :: Either ParseError Digit -- Right A ---- --
-- >>> isn't _Right (parse parseA "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= 'A' ==> isn't _Right (parse parseA "test" [c] :: Either ParseError Digit) --parseA :: (DA d, CharParsing p) => p d instance Data.Digit.DA.DA () instance Data.Digit.DA.DA Data.Digit.Digit.Digit module Data.Digit.DAa type DAa a = (DA a, Da a) -- |
-- >>> parse (parseAa <* eof) "test" "A" :: Either ParseError Digit -- Right A ---- --
-- >>> parse parseAa "test" "Axyz" :: Either ParseError Digit -- Right A ---- --
-- >>> parse (parseAa <* eof) "test" "a" :: Either ParseError Digit -- Right a ---- --
-- >>> parse parseAa "test" "axyz" :: Either ParseError Digit -- Right a ---- --
-- >>> isn't _Right (parse parseAa "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "Aa") ==> isn't _Right (parse parseAa "test" [c] :: Either ParseError Digit) --parseAa :: (DAa d, CharParsing p) => p d module Data.Digit.D9 class D9 d d9 :: D9 d => Prism' d () x9 :: D9 d => d -- |
-- >>> parse (parse9 <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parse9 "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> isn't _Right (parse parse9 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '9' ==> isn't _Right (parse parse9 "test" [c] :: Either ParseError Digit) --parse9 :: (D9 d, CharParsing p) => p d instance Data.Digit.D9.D9 () instance Data.Digit.D9.D9 Data.Digit.Digit.Digit module Data.Digit.D8 class D8 d d8 :: D8 d => Prism' d () x8 :: D8 d => d -- |
-- >>> 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) --parse8 :: (D8 d, CharParsing p) => p d instance Data.Digit.D8.D8 () instance Data.Digit.D8.D8 Data.Digit.Digit.Digit module Data.Digit.D7 class D7 d d7 :: D7 d => Prism' d () x7 :: D7 d => d -- |
-- >>> parse (parse7 <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parse7 "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> isn't _Right (parse parse7 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '7' ==> isn't _Right (parse parse7 "test" [c] :: Either ParseError Digit) --parse7 :: (D7 d, CharParsing p) => p d instance Data.Digit.D7.D7 () instance Data.Digit.D7.D7 Data.Digit.Digit.Digit module Data.Digit.D6 class D6 d d6 :: D6 d => Prism' d () x6 :: D6 d => d -- |
-- >>> parse (parse6 <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parse6 "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> isn't _Right (parse parse6 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '6' ==> isn't _Right (parse parse6 "test" [c] :: Either ParseError Digit) --parse6 :: (D6 d, CharParsing p) => p d instance Data.Digit.D6.D6 () instance Data.Digit.D6.D6 Data.Digit.Digit.Digit module Data.Digit.D5 class D5 d d5 :: D5 d => Prism' d () x5 :: D5 d => d -- |
-- >>> 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) --parse5 :: (D5 d, CharParsing p) => p d instance Data.Digit.D5.D5 () instance Data.Digit.D5.D5 Data.Digit.Digit.Digit module Data.Digit.D4 class D4 d d4 :: D4 d => Prism' d () x4 :: D4 d => d -- |
-- >>> parse (parse4 <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parse4 "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> isn't _Right (parse parse4 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '4' ==> isn't _Right (parse parse4 "test" [c] :: Either ParseError Digit) --parse4 :: (D4 d, CharParsing p) => p d instance Data.Digit.D4.D4 () instance Data.Digit.D4.D4 Data.Digit.Digit.Digit module Data.Digit.D3 class D3 d d3 :: D3 d => Prism' d () x3 :: D3 d => d -- |
-- >>> parse (parse3 <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parse3 "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> isn't _Right (parse parse3 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '3' ==> isn't _Right (parse parse3 "test" [c] :: Either ParseError Digit) --parse3 :: (D3 d, CharParsing p) => p d instance Data.Digit.D3.D3 () instance Data.Digit.D3.D3 Data.Digit.Digit.Digit module Data.Digit.D2 class D2 d d2 :: D2 d => Prism' d () x2 :: D2 d => d -- |
-- >>> parse (parse2 <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parse2 "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> isn't _Right (parse parse2 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '2' ==> isn't _Right (parse parse2 "test" [c] :: Either ParseError Digit) --parse2 :: (D2 d, CharParsing p) => p d instance Data.Digit.D2.D2 () instance Data.Digit.D2.D2 Data.Digit.Digit.Digit module Data.Digit.D1 class D1 d d1 :: D1 d => Prism' d () x1 :: D1 d => d -- |
-- >>> parse (parse1 <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parse1 "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> isn't _Right (parse parse1 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '1' ==> isn't _Right (parse parse1 "test" [c] :: Either ParseError Digit) --parse1 :: (D1 d, CharParsing p) => p d instance Data.Digit.D1.D1 () instance Data.Digit.D1.D1 Data.Digit.Digit.Digit module Data.Digit.D0 class D0 d d0 :: D0 d => Prism' d () x0 :: D0 d => d -- |
-- >>> parse (parse0 <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parse0 "test" "0xyz" :: Either ParseError Digit -- Right 0 ---- --
-- >>> isn't _Right (parse parse0 "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> c /= '0' ==> isn't _Right (parse parse0 "test" [c] :: Either ParseError Digit) --parse0 :: (D0 d, CharParsing p) => p d instance Data.Digit.D0.D0 () instance Data.Digit.D0.D0 Data.Digit.Digit.Digit module Data.Digit.Decimal type DecimalNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d, D8 d, D9 d) type Decimal d = (D0 d, DecimalNoZero d) -- |
-- >>> parse (parseDecimalNoZero <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseDecimalNoZero "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseDecimalNoZero "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseDecimalNoZero "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseDecimalNoZero "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseDecimalNoZero "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseDecimalNoZero "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseDecimalNoZero "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseDecimalNoZero "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseDecimalNoZero <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseDecimalNoZero "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> isn't _Right (parse parseDecimalNoZero "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "123456789") ==> isn't _Right (parse parseDecimalNoZero "test" [c] :: Either ParseError Digit) --parseDecimalNoZero :: (DecimalNoZero d, CharParsing p) => p d -- |
-- >>> parse (parseDecimal <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parseDecimal "test" "0xyz" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse (parseDecimal <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseDecimal "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseDecimal <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseDecimal "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseDecimal <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseDecimal "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseDecimal <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseDecimal "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseDecimal <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseDecimal "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseDecimal <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseDecimal "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseDecimal <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseDecimal "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseDecimal <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseDecimal "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseDecimal <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseDecimal "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> isn't _Right (parse parseDecimal "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "0123456789") ==> isn't _Right (parse parseDecimal "test" [c] :: Either ParseError Digit) --parseDecimal :: (Decimal d, CharParsing p) => p d module Data.Digit.Binary type BinaryNoZero d = D1 d type Binary d = (D0 d, BinaryNoZero d) -- |
-- >>> parse (parseBinaryNoZero <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseBinaryNoZero "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> isn't _Right (parse parseBinaryNoZero "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "1") ==> isn't _Right (parse parseBinaryNoZero "test" [c] :: Either ParseError Digit) --parseBinaryNoZero :: (BinaryNoZero d, CharParsing p) => p d -- |
-- >>> parse (parseBinary <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parseBinary "test" "0xyz" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse (parseBinary <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseBinary "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> isn't _Right (parse parseBinary "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "01") ==> isn't _Right (parse parseBinary "test" [c] :: Either ParseError Digit) --parseBinary :: (Binary d, CharParsing p) => p d module Data.Digit.HEXADECIMAL type HEXADECIMALNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d, D8 d, D9 d, DA d, DB d, DC d, DD d, DE d, DF d) type HEXADECIMAL d = (D0 d, HEXADECIMALNoZero d) -- |
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "A" :: Either ParseError Digit -- Right A ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "Axyz" :: Either ParseError Digit -- Right A ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "B" :: Either ParseError Digit -- Right B ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "Bxyz" :: Either ParseError Digit -- Right B ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "C" :: Either ParseError Digit -- Right C ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "Cxyz" :: Either ParseError Digit -- Right C ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "D" :: Either ParseError Digit -- Right D ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "Dxyz" :: Either ParseError Digit -- Right D ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "E" :: Either ParseError Digit -- Right E ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "Exyz" :: Either ParseError Digit -- Right E ---- --
-- >>> parse (parseHEXADECIMALNoZero <* eof) "test" "F" :: Either ParseError Digit -- Right F ---- --
-- >>> parse parseHEXADECIMALNoZero "test" "Fxyz" :: Either ParseError Digit -- Right F ---- --
-- >>> isn't _Right (parse parseHEXADECIMALNoZero "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "123456789ABCDEF") ==> isn't _Right (parse parseHEXADECIMALNoZero "test" [c] :: Either ParseError Digit) --parseHEXADECIMALNoZero :: (HEXADECIMALNoZero d, CharParsing p) => p d -- |
-- >>> parse (parseHEXADECIMAL <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parseHEXADECIMAL "test" "0xyz" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseHEXADECIMAL "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseHEXADECIMAL "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseHEXADECIMAL "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseHEXADECIMAL "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseHEXADECIMAL "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseHEXADECIMAL "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseHEXADECIMAL "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseHEXADECIMAL "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseHEXADECIMAL "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "A" :: Either ParseError Digit -- Right A ---- --
-- >>> parse parseHEXADECIMAL "test" "Axyz" :: Either ParseError Digit -- Right A ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "B" :: Either ParseError Digit -- Right B ---- --
-- >>> parse parseHEXADECIMAL "test" "Bxyz" :: Either ParseError Digit -- Right B ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "C" :: Either ParseError Digit -- Right C ---- --
-- >>> parse parseHEXADECIMAL "test" "Cxyz" :: Either ParseError Digit -- Right C ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "D" :: Either ParseError Digit -- Right D ---- --
-- >>> parse parseHEXADECIMAL "test" "Dxyz" :: Either ParseError Digit -- Right D ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "E" :: Either ParseError Digit -- Right E ---- --
-- >>> parse parseHEXADECIMAL "test" "Exyz" :: Either ParseError Digit -- Right E ---- --
-- >>> parse (parseHEXADECIMAL <* eof) "test" "F" :: Either ParseError Digit -- Right F ---- --
-- >>> parse parseHEXADECIMAL "test" "Fxyz" :: Either ParseError Digit -- Right F ---- --
-- >>> isn't _Right (parse parseHEXADECIMAL "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "0123456789ABCDEF") ==> isn't _Right (parse parseHEXADECIMAL "test" [c] :: Either ParseError Digit) --parseHEXADECIMAL :: (HEXADECIMAL d, CharParsing p) => p d module Data.Digit.HeXaDeCiMaL type HeXaDeCiMaLNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d, D8 d, D9 d, DA d, DB d, DC d, DD d, DE d, DF d, Da d, Db d, Dc d, Dd d, De d, De d, Df d) type HeXaDeCiMaL d = (D0 d, HeXaDeCiMaLNoZero d) -- |
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "a" :: Either ParseError Digit -- Right a ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "axyz" :: Either ParseError Digit -- Right a ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "b" :: Either ParseError Digit -- Right b ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "bxyz" :: Either ParseError Digit -- Right b ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "c" :: Either ParseError Digit -- Right c ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "cxyz" :: Either ParseError Digit -- Right c ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "d" :: Either ParseError Digit -- Right d ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "dxyz" :: Either ParseError Digit -- Right d ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "e" :: Either ParseError Digit -- Right e ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "exyz" :: Either ParseError Digit -- Right e ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "f" :: Either ParseError Digit -- Right f ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "fxyz" :: Either ParseError Digit -- Right f ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "A" :: Either ParseError Digit -- Right A ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "Axyz" :: Either ParseError Digit -- Right A ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "B" :: Either ParseError Digit -- Right B ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "Bxyz" :: Either ParseError Digit -- Right B ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "C" :: Either ParseError Digit -- Right C ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "Cxyz" :: Either ParseError Digit -- Right C ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "D" :: Either ParseError Digit -- Right D ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "Dxyz" :: Either ParseError Digit -- Right D ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "E" :: Either ParseError Digit -- Right E ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "Exyz" :: Either ParseError Digit -- Right E ---- --
-- >>> parse (parseHeXaDeCiMaLNoZero <* eof) "test" "F" :: Either ParseError Digit -- Right F ---- --
-- >>> parse parseHeXaDeCiMaLNoZero "test" "Fxyz" :: Either ParseError Digit -- Right F ---- --
-- >>> isn't _Right (parse parseHeXaDeCiMaLNoZero "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "123456789abcdefABCDEF") ==> isn't _Right (parse parseHeXaDeCiMaLNoZero "test" [c] :: Either ParseError Digit) --parseHeXaDeCiMaLNoZero :: (HeXaDeCiMaLNoZero d, CharParsing p) => p d -- |
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "0xyz" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseHeXaDeCiMaL "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "a" :: Either ParseError Digit -- Right a ---- --
-- >>> parse parseHeXaDeCiMaL "test" "axyz" :: Either ParseError Digit -- Right a ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "b" :: Either ParseError Digit -- Right b ---- --
-- >>> parse parseHeXaDeCiMaL "test" "bxyz" :: Either ParseError Digit -- Right b ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "c" :: Either ParseError Digit -- Right c ---- --
-- >>> parse parseHeXaDeCiMaL "test" "cxyz" :: Either ParseError Digit -- Right c ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "d" :: Either ParseError Digit -- Right d ---- --
-- >>> parse parseHeXaDeCiMaL "test" "dxyz" :: Either ParseError Digit -- Right d ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "e" :: Either ParseError Digit -- Right e ---- --
-- >>> parse parseHeXaDeCiMaL "test" "exyz" :: Either ParseError Digit -- Right e ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "f" :: Either ParseError Digit -- Right f ---- --
-- >>> parse parseHeXaDeCiMaL "test" "fxyz" :: Either ParseError Digit -- Right f ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "A" :: Either ParseError Digit -- Right A ---- --
-- >>> parse parseHeXaDeCiMaL "test" "Axyz" :: Either ParseError Digit -- Right A ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "B" :: Either ParseError Digit -- Right B ---- --
-- >>> parse parseHeXaDeCiMaL "test" "Bxyz" :: Either ParseError Digit -- Right B ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "C" :: Either ParseError Digit -- Right C ---- --
-- >>> parse parseHeXaDeCiMaL "test" "Cxyz" :: Either ParseError Digit -- Right C ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "D" :: Either ParseError Digit -- Right D ---- --
-- >>> parse parseHeXaDeCiMaL "test" "Dxyz" :: Either ParseError Digit -- Right D ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "E" :: Either ParseError Digit -- Right E ---- --
-- >>> parse parseHeXaDeCiMaL "test" "Exyz" :: Either ParseError Digit -- Right E ---- --
-- >>> parse (parseHeXaDeCiMaL <* eof) "test" "F" :: Either ParseError Digit -- Right F ---- --
-- >>> parse parseHeXaDeCiMaL "test" "Fxyz" :: Either ParseError Digit -- Right F ---- --
-- >>> isn't _Right (parse parseHeXaDeCiMaL "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "0123456789abcdefABCDEF") ==> isn't _Right (parse parseHeXaDeCiMaL "test" [c] :: Either ParseError Digit) --parseHeXaDeCiMaL :: (HeXaDeCiMaL d, CharParsing p) => p d module Data.Digit.Hexadecimal type HexadecimalNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d, D8 d, D9 d, Da d, Db d, Dc d, Dd d, De d, De d, Df d) type Hexadecimal d = (D0 d, HexadecimalNoZero d) -- |
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseHexadecimalNoZero "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseHexadecimalNoZero "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseHexadecimalNoZero "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseHexadecimalNoZero "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseHexadecimalNoZero "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseHexadecimalNoZero "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseHexadecimalNoZero "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseHexadecimalNoZero "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseHexadecimalNoZero "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "a" :: Either ParseError Digit -- Right a ---- --
-- >>> parse parseHexadecimalNoZero "test" "axyz" :: Either ParseError Digit -- Right a ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "b" :: Either ParseError Digit -- Right b ---- --
-- >>> parse parseHexadecimalNoZero "test" "bxyz" :: Either ParseError Digit -- Right b ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "c" :: Either ParseError Digit -- Right c ---- --
-- >>> parse parseHexadecimalNoZero "test" "cxyz" :: Either ParseError Digit -- Right c ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "d" :: Either ParseError Digit -- Right d ---- --
-- >>> parse parseHexadecimalNoZero "test" "dxyz" :: Either ParseError Digit -- Right d ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "e" :: Either ParseError Digit -- Right e ---- --
-- >>> parse parseHexadecimalNoZero "test" "exyz" :: Either ParseError Digit -- Right e ---- --
-- >>> parse (parseHexadecimalNoZero <* eof) "test" "f" :: Either ParseError Digit -- Right f ---- --
-- >>> parse parseHexadecimalNoZero "test" "fxyz" :: Either ParseError Digit -- Right f ---- --
-- >>> isn't _Right (parse parseHexadecimalNoZero "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "123456789abcdef") ==> isn't _Right (parse parseHexadecimalNoZero "test" [c] :: Either ParseError Digit) --parseHexadecimalNoZero :: (HexadecimalNoZero d, CharParsing p) => p d -- |
-- >>> parse (parseHexadecimal <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parseHexadecimal "test" "0xyz" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseHexadecimal "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseHexadecimal "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseHexadecimal "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseHexadecimal "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseHexadecimal "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseHexadecimal "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseHexadecimal "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "8" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse parseHexadecimal "test" "8xyz" :: Either ParseError Digit -- Right 8 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "9" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse parseHexadecimal "test" "9xyz" :: Either ParseError Digit -- Right 9 ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "a" :: Either ParseError Digit -- Right a ---- --
-- >>> parse parseHexadecimal "test" "axyz" :: Either ParseError Digit -- Right a ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "b" :: Either ParseError Digit -- Right b ---- --
-- >>> parse parseHexadecimal "test" "bxyz" :: Either ParseError Digit -- Right b ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "c" :: Either ParseError Digit -- Right c ---- --
-- >>> parse parseHexadecimal "test" "cxyz" :: Either ParseError Digit -- Right c ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "d" :: Either ParseError Digit -- Right d ---- --
-- >>> parse parseHexadecimal "test" "dxyz" :: Either ParseError Digit -- Right d ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "e" :: Either ParseError Digit -- Right e ---- --
-- >>> parse parseHexadecimal "test" "exyz" :: Either ParseError Digit -- Right e ---- --
-- >>> parse (parseHexadecimal <* eof) "test" "f" :: Either ParseError Digit -- Right f ---- --
-- >>> parse parseHexadecimal "test" "fxyz" :: Either ParseError Digit -- Right f ---- --
-- >>> isn't _Right (parse parseHexadecimal "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "0123456789abcdef") ==> isn't _Right (parse parseHexadecimal "test" [c] :: Either ParseError Digit) --parseHexadecimal :: (Hexadecimal d, CharParsing p) => p d module Data.Digit.Octal type OctalNoZero d = (D1 d, D2 d, D3 d, D4 d, D5 d, D6 d, D7 d) type Octal d = (D0 d, OctalNoZero d) -- |
-- >>> parse (parseOctalNoZero <* eof) "test" "1" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseOctalNoZero "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseOctalNoZero <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseOctalNoZero "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseOctalNoZero <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseOctalNoZero "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseOctalNoZero <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseOctalNoZero "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseOctalNoZero <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseOctalNoZero "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseOctalNoZero <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseOctalNoZero "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseOctalNoZero <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseOctalNoZero "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> isn't _Right (parse parseOctalNoZero "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "1234567") ==> isn't _Right (parse parseOctalNoZero "test" [c] :: Either ParseError Digit) --parseOctalNoZero :: (OctalNoZero d, CharParsing p) => p d -- |
-- >>> parse (parseOctal <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse (parseOctal <* eof) "test" "0" :: Either ParseError Digit -- Right 0 ---- --
-- >>> parse parseOctal "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse parseOctal "test" "1xyz" :: Either ParseError Digit -- Right 1 ---- --
-- >>> parse (parseOctal <* eof) "test" "2" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse parseOctal "test" "2xyz" :: Either ParseError Digit -- Right 2 ---- --
-- >>> parse (parseOctal <* eof) "test" "3" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse parseOctal "test" "3xyz" :: Either ParseError Digit -- Right 3 ---- --
-- >>> parse (parseOctal <* eof) "test" "4" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse parseOctal "test" "4xyz" :: Either ParseError Digit -- Right 4 ---- --
-- >>> parse (parseOctal <* eof) "test" "5" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse parseOctal "test" "5xyz" :: Either ParseError Digit -- Right 5 ---- --
-- >>> parse (parseOctal <* eof) "test" "6" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse parseOctal "test" "6xyz" :: Either ParseError Digit -- Right 6 ---- --
-- >>> parse (parseOctal <* eof) "test" "7" :: Either ParseError Digit -- Right 7 ---- --
-- >>> parse parseOctal "test" "7xyz" :: Either ParseError Digit -- Right 7 ---- --
-- >>> isn't _Right (parse parseOctal "test" "xyz" :: Either ParseError Digit) -- True ---- --
-- \c -> (c `notElem` "01234567") ==> isn't _Right (parse parseOctal "test" [c] :: Either ParseError Digit) --parseOctal :: (Octal d, CharParsing p) => p d module Data.Digit.Integral -- |
-- >>> 1 ^? integralBinaryNoZero -- Just () ---- --
-- >>> integralBinaryNoZero # Digit1 :: Integer -- 1 ---- --
-- \c -> c /= 1 ==> (c ^? integralBinaryNoZero == Nothing) --integralBinaryNoZero :: (Integral a, BinaryNoZero d) => Prism' a d -- |
-- >>> 0 ^? integralBinary :: Maybe Digit -- Just 0 ---- --
-- >>> 1 ^? integralBinary :: Maybe Digit -- Just 1 ---- --
-- >>> integralBinary # Digit0 :: Integer -- 0 ---- --
-- >>> integralBinary # Digit1 :: Integer -- 1 ---- --
-- \c -> (c `notElem` [0, 1]) ==> (c ^? integralBinary == Nothing) --integralBinary :: (Integral a, Binary d) => Prism' a d -- |
-- >>> 1 ^? integralOctalNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralOctalNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralOctalNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralOctalNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralOctalNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralOctalNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralOctalNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> integralOctalNoZero # Digit1 :: Integer -- 1 ---- --
-- >>> integralOctalNoZero # Digit2 :: Integer -- 2 ---- --
-- >>> integralOctalNoZero # Digit3 :: Integer -- 3 ---- --
-- >>> integralOctalNoZero # Digit4 :: Integer -- 4 ---- --
-- >>> integralOctalNoZero # Digit5 :: Integer -- 5 ---- --
-- >>> integralOctalNoZero # Digit6 :: Integer -- 6 ---- --
-- >>> integralOctalNoZero # Digit7 :: Integer -- 7 ---- --
-- \c -> (c `notElem` [1..7]) ==> (c ^? integralOctalNoZero == Nothing) --integralOctalNoZero :: (Integral a, OctalNoZero d) => Prism' a d -- |
-- >>> 0 ^? integralOctal :: Maybe Digit -- Just 0 ---- --
-- >>> 1 ^? integralOctal :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralOctal :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralOctal :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralOctal :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralOctal :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralOctal :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralOctal :: Maybe Digit -- Just 7 ---- --
-- >>> integralOctal # Digit0 :: Integer -- 0 ---- --
-- >>> integralOctal # Digit1 :: Integer -- 1 ---- --
-- >>> integralOctal # Digit2 :: Integer -- 2 ---- --
-- >>> integralOctal # Digit3 :: Integer -- 3 ---- --
-- >>> integralOctal # Digit4 :: Integer -- 4 ---- --
-- >>> integralOctal # Digit5 :: Integer -- 5 ---- --
-- >>> integralOctal # Digit6 :: Integer -- 6 ---- --
-- >>> integralOctal # Digit7 :: Integer -- 7 ---- --
-- \c -> (c `notElem` [0..7]) ==> (c ^? integralOctal == Nothing) --integralOctal :: (Integral a, Octal d) => Prism' a d -- |
-- >>> 0 ^? integralDecimal :: Maybe Digit -- Just 0 ---- --
-- >>> 1 ^? integralDecimal :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralDecimal :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralDecimal :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralDecimal :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralDecimal :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralDecimal :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralDecimal :: Maybe Digit -- Just 7 ---- --
-- >>> 8 ^? integralDecimal :: Maybe Digit -- Just 8 ---- --
-- >>> 9 ^? integralDecimal :: Maybe Digit -- Just 9 ---- --
-- >>> integralDecimal # Digit0 :: Integer -- 0 ---- --
-- >>> integralDecimal # Digit1 :: Integer -- 1 ---- --
-- >>> integralDecimal # Digit2 :: Integer -- 2 ---- --
-- >>> integralDecimal # Digit3 :: Integer -- 3 ---- --
-- >>> integralDecimal # Digit4 :: Integer -- 4 ---- --
-- >>> integralDecimal # Digit5 :: Integer -- 5 ---- --
-- >>> integralDecimal # Digit6 :: Integer -- 6 ---- --
-- >>> integralDecimal # Digit7 :: Integer -- 7 ---- --
-- >>> integralDecimal # Digit8 :: Integer -- 8 ---- --
-- >>> integralDecimal # Digit9 :: Integer -- 9 ---- --
-- \c -> (c `notElem` [0..9]) ==> (c ^? integralDecimal == Nothing) --integralDecimal :: (Integral a, Decimal d) => Prism' a d -- |
-- >>> 1 ^? integralDecimalNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralDecimalNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralDecimalNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralDecimalNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralDecimalNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralDecimalNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralDecimalNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> 8 ^? integralDecimalNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> 9 ^? integralDecimalNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> integralDecimalNoZero # Digit1 :: Integer -- 1 ---- --
-- >>> integralDecimalNoZero # Digit2 :: Integer -- 2 ---- --
-- >>> integralDecimalNoZero # Digit3 :: Integer -- 3 ---- --
-- >>> integralDecimalNoZero # Digit4 :: Integer -- 4 ---- --
-- >>> integralDecimalNoZero # Digit5 :: Integer -- 5 ---- --
-- >>> integralDecimalNoZero # Digit6 :: Integer -- 6 ---- --
-- >>> integralDecimalNoZero # Digit7 :: Integer -- 7 ---- --
-- >>> integralDecimalNoZero # Digit8 :: Integer -- 8 ---- --
-- >>> integralDecimalNoZero # Digit9 :: Integer -- 9 ---- --
-- \c -> (c `notElem` [1..9]) ==> (c ^? integralDecimalNoZero == Nothing) --integralDecimalNoZero :: (Integral a, DecimalNoZero d) => Prism' a d -- |
-- >>> 1 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> 8 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> 9 ^? integralHexadecimalNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> 10 ^? integralHexadecimalNoZero :: Maybe Digit -- Just a ---- --
-- >>> 11 ^? integralHexadecimalNoZero :: Maybe Digit -- Just b ---- --
-- >>> 12 ^? integralHexadecimalNoZero :: Maybe Digit -- Just c ---- --
-- >>> 13 ^? integralHexadecimalNoZero :: Maybe Digit -- Just d ---- --
-- >>> 14 ^? integralHexadecimalNoZero :: Maybe Digit -- Just e ---- --
-- >>> 15 ^? integralHexadecimalNoZero :: Maybe Digit -- Just f ---- --
-- >>> integralHexadecimalNoZero # Digit1 :: Integer -- 1 ---- --
-- >>> integralHexadecimalNoZero # Digit2 :: Integer -- 2 ---- --
-- >>> integralHexadecimalNoZero # Digit3 :: Integer -- 3 ---- --
-- >>> integralHexadecimalNoZero # Digit4 :: Integer -- 4 ---- --
-- >>> integralHexadecimalNoZero # Digit5 :: Integer -- 5 ---- --
-- >>> integralHexadecimalNoZero # Digit6 :: Integer -- 6 ---- --
-- >>> integralHexadecimalNoZero # Digit7 :: Integer -- 7 ---- --
-- >>> integralHexadecimalNoZero # Digit8 :: Integer -- 8 ---- --
-- >>> integralHexadecimalNoZero # Digit9 :: Integer -- 9 ---- --
-- >>> integralHexadecimalNoZero # Digita :: Integer -- 10 ---- --
-- >>> integralHexadecimalNoZero # Digitb :: Integer -- 11 ---- --
-- >>> integralHexadecimalNoZero # Digitc :: Integer -- 12 ---- --
-- >>> integralHexadecimalNoZero # Digitd :: Integer -- 13 ---- --
-- >>> integralHexadecimalNoZero # Digite :: Integer -- 14 ---- --
-- >>> integralHexadecimalNoZero # Digitf :: Integer -- 15 ---- --
-- \c -> (c `notElem` [1..15]) ==> (c ^? integralHexadecimalNoZero == Nothing) --integralHexadecimalNoZero :: (Integral a, HexadecimalNoZero d) => Prism' a d -- |
-- >>> 0 ^? integralHexadecimal :: Maybe Digit -- Just 0 ---- --
-- >>> 1 ^? integralHexadecimal :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralHexadecimal :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralHexadecimal :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralHexadecimal :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralHexadecimal :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralHexadecimal :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralHexadecimal :: Maybe Digit -- Just 7 ---- --
-- >>> 8 ^? integralHexadecimal :: Maybe Digit -- Just 8 ---- --
-- >>> 9 ^? integralHexadecimal :: Maybe Digit -- Just 9 ---- --
-- >>> 10 ^? integralHexadecimal :: Maybe Digit -- Just a ---- --
-- >>> 11 ^? integralHexadecimal :: Maybe Digit -- Just b ---- --
-- >>> 12 ^? integralHexadecimal :: Maybe Digit -- Just c ---- --
-- >>> 13 ^? integralHexadecimal :: Maybe Digit -- Just d ---- --
-- >>> 14 ^? integralHexadecimal :: Maybe Digit -- Just e ---- --
-- >>> 15 ^? integralHexadecimal :: Maybe Digit -- Just f ---- --
-- >>> integralHexadecimal # Digit0 :: Integer -- 0 ---- --
-- >>> integralHexadecimal # Digit1 :: Integer -- 1 ---- --
-- >>> integralHexadecimal # Digit2 :: Integer -- 2 ---- --
-- >>> integralHexadecimal # Digit3 :: Integer -- 3 ---- --
-- >>> integralHexadecimal # Digit4 :: Integer -- 4 ---- --
-- >>> integralHexadecimal # Digit5 :: Integer -- 5 ---- --
-- >>> integralHexadecimal # Digit6 :: Integer -- 6 ---- --
-- >>> integralHexadecimal # Digit7 :: Integer -- 7 ---- --
-- >>> integralHexadecimal # Digit8 :: Integer -- 8 ---- --
-- >>> integralHexadecimal # Digit9 :: Integer -- 9 ---- --
-- >>> integralHexadecimal # Digita :: Integer -- 10 ---- --
-- >>> integralHexadecimal # Digitb :: Integer -- 11 ---- --
-- >>> integralHexadecimal # Digitc :: Integer -- 12 ---- --
-- >>> integralHexadecimal # Digitd :: Integer -- 13 ---- --
-- >>> integralHexadecimal # Digite :: Integer -- 14 ---- --
-- >>> integralHexadecimal # Digitf :: Integer -- 15 ---- --
-- \c -> (c `notElem` [0..15]) ==> (c ^? integralHexadecimal == Nothing) --integralHexadecimal :: (Integral a, Hexadecimal d) => Prism' a d -- |
-- >>> 1 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> 8 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> 9 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> 10 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just A ---- --
-- >>> 11 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just B ---- --
-- >>> 12 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just C ---- --
-- >>> 13 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just D ---- --
-- >>> 14 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just E ---- --
-- >>> 15 ^? integralHEXADECIMALNoZero :: Maybe Digit -- Just F ---- --
-- >>> integralHEXADECIMALNoZero # Digit1 :: Integer -- 1 ---- --
-- >>> integralHEXADECIMALNoZero # Digit2 :: Integer -- 2 ---- --
-- >>> integralHEXADECIMALNoZero # Digit3 :: Integer -- 3 ---- --
-- >>> integralHEXADECIMALNoZero # Digit4 :: Integer -- 4 ---- --
-- >>> integralHEXADECIMALNoZero # Digit5 :: Integer -- 5 ---- --
-- >>> integralHEXADECIMALNoZero # Digit6 :: Integer -- 6 ---- --
-- >>> integralHEXADECIMALNoZero # Digit7 :: Integer -- 7 ---- --
-- >>> integralHEXADECIMALNoZero # Digit8 :: Integer -- 8 ---- --
-- >>> integralHEXADECIMALNoZero # Digit9 :: Integer -- 9 ---- --
-- >>> integralHEXADECIMALNoZero # DigitA :: Integer -- 10 ---- --
-- >>> integralHEXADECIMALNoZero # DigitB :: Integer -- 11 ---- --
-- >>> integralHEXADECIMALNoZero # DigitC :: Integer -- 12 ---- --
-- >>> integralHEXADECIMALNoZero # DigitD :: Integer -- 13 ---- --
-- >>> integralHEXADECIMALNoZero # DigitE :: Integer -- 14 ---- --
-- >>> integralHEXADECIMALNoZero # DigitF :: Integer -- 15 ---- --
-- \c -> (c `notElem` [1..15]) ==> (c ^? integralHEXADECIMALNoZero == Nothing) --integralHEXADECIMALNoZero :: (Integral a, HEXADECIMALNoZero d) => Prism' a d -- |
-- >>> 0 ^? integralHEXADECIMAL :: Maybe Digit -- Just 0 ---- --
-- >>> 1 ^? integralHEXADECIMAL :: Maybe Digit -- Just 1 ---- --
-- >>> 2 ^? integralHEXADECIMAL :: Maybe Digit -- Just 2 ---- --
-- >>> 3 ^? integralHEXADECIMAL :: Maybe Digit -- Just 3 ---- --
-- >>> 4 ^? integralHEXADECIMAL :: Maybe Digit -- Just 4 ---- --
-- >>> 5 ^? integralHEXADECIMAL :: Maybe Digit -- Just 5 ---- --
-- >>> 6 ^? integralHEXADECIMAL :: Maybe Digit -- Just 6 ---- --
-- >>> 7 ^? integralHEXADECIMAL :: Maybe Digit -- Just 7 ---- --
-- >>> 8 ^? integralHEXADECIMAL :: Maybe Digit -- Just 8 ---- --
-- >>> 9 ^? integralHEXADECIMAL :: Maybe Digit -- Just 9 ---- --
-- >>> 10 ^? integralHEXADECIMAL :: Maybe Digit -- Just A ---- --
-- >>> 11 ^? integralHEXADECIMAL :: Maybe Digit -- Just B ---- --
-- >>> 12 ^? integralHEXADECIMAL :: Maybe Digit -- Just C ---- --
-- >>> 13 ^? integralHEXADECIMAL :: Maybe Digit -- Just D ---- --
-- >>> 14 ^? integralHEXADECIMAL :: Maybe Digit -- Just E ---- --
-- >>> 15 ^? integralHEXADECIMAL :: Maybe Digit -- Just F ---- --
-- >>> integralHEXADECIMAL # Digit0 :: Integer -- 0 ---- --
-- >>> integralHEXADECIMAL # Digit1 :: Integer -- 1 ---- --
-- >>> integralHEXADECIMAL # Digit2 :: Integer -- 2 ---- --
-- >>> integralHEXADECIMAL # Digit3 :: Integer -- 3 ---- --
-- >>> integralHEXADECIMAL # Digit4 :: Integer -- 4 ---- --
-- >>> integralHEXADECIMAL # Digit5 :: Integer -- 5 ---- --
-- >>> integralHEXADECIMAL # Digit6 :: Integer -- 6 ---- --
-- >>> integralHEXADECIMAL # Digit7 :: Integer -- 7 ---- --
-- >>> integralHEXADECIMAL # Digit8 :: Integer -- 8 ---- --
-- >>> integralHEXADECIMAL # Digit9 :: Integer -- 9 ---- --
-- >>> integralHEXADECIMAL # DigitA :: Integer -- 10 ---- --
-- >>> integralHEXADECIMAL # DigitB :: Integer -- 11 ---- --
-- >>> integralHEXADECIMAL # DigitC :: Integer -- 12 ---- --
-- >>> integralHEXADECIMAL # DigitD :: Integer -- 13 ---- --
-- >>> integralHEXADECIMAL # DigitE :: Integer -- 14 ---- --
-- >>> integralHEXADECIMAL # DigitF :: Integer -- 15 ---- --
-- \c -> (c `notElem` [0..15]) ==> (c ^? integralHEXADECIMAL == Nothing) --integralHEXADECIMAL :: (Integral a, HEXADECIMAL d) => Prism' a d module Data.Digit.Natural -- |
-- >>> _NaturalDigits # 0 -- 0 :| [] ---- --
-- >>> _NaturalDigits # 1 -- 1 :| [] ---- --
-- >>> _NaturalDigits # 9223372036854775807 -- 9 :| [2,2,3,3,7,2,0,3,6,8,5,4,7,7,5,8,0,7] ---- --
-- >>> (9 :| [2,2,3,3,7,2,0,3,6,8,5,4,7,7,5,8,0,7]) ^? _NaturalDigits -- Just 9223372036854775807 ---- --
-- >>> (1 :| []) ^? _NaturalDigits -- Just 1 ---- --
-- \x -> digitsToNatural ( naturalToDigits x ) == Just x --_NaturalDigits :: Prism' (NonEmpty Digit) Natural -- | NonEmpty Digits from a Natural number -- --
-- >>> naturalDigits 0 -- 0 :| [] ---- --
-- >>> naturalDigits 9 -- 9 :| [] ---- --
-- >>> naturalDigits 393564 -- 3 :| [9,3,5,6,4] ---- --
-- >>> naturalDigits 9223372036854775807 -- 9 :| [2,2,3,3,7,2,0,3,6,8,5,4,7,7,5,8,0,7] --naturalToDigits :: Natural -> NonEmpty Digit -- | Create a number from a list of digits with the integer bounds of the -- machine. -- --
-- >>> naturalFromDigits (D.x3 :| [D.x4]) -- Just 34 ---- --
-- >>> naturalFromDigits (D.Digit3 :| [D.Digit9,D.Digit3,D.Digit5,D.Digit6,D.Digit4]) -- Just 393564 ---- --
-- >>> naturalFromDigits (D.x0 :| []) -- Just 0 ---- -- Int maxBound for Int64 >>> naturalFromDigits (D.x9 :| -- [D.x2,D.x2,D.x3,D.x3,D.x7,D.x2,D.x0,D.x3,D.x6,D.x8,D.x5,D.x4,D.x7,D.x7,D.x5,D.x8,D.x0,D.x7]) -- Just 9223372036854775807 -- -- Int maxBound + 1 for Int64 >>> naturalFromDigits (D.x9 :| -- [D.x2,D.x2,D.x3,D.x3,D.x7,D.x2,D.x0,D.x3,D.x6,D.x8,D.x5,D.x4,D.x7,D.x7,D.x5,D.x8,D.x0,D.x8]) -- Nothing digitsToNatural :: NonEmpty Digit -> Maybe Natural module Data.Digit.Char -- |
-- >>> '1' ^? charBinaryNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> charBinaryNoZero # Digit1 -- '1' ---- --
-- \c -> c /= '1' ==> (c ^? charBinaryNoZero == Nothing) --charBinaryNoZero :: BinaryNoZero d => Prism' Char d -- |
-- >>> '0' ^? charBinary :: Maybe Digit -- Just 0 ---- --
-- >>> '1' ^? charBinary :: Maybe Digit -- Just 1 ---- --
-- >>> charBinary # Digit0 :: Char -- '0' ---- --
-- >>> charBinary # Digit1 :: Char -- '1' ---- --
-- \c -> (c `notElem` "01") ==> (c ^? charBinary == Nothing) --charBinary :: Binary d => Prism' Char d -- |
-- >>> '1' ^? charOctalNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charOctalNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charOctalNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charOctalNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charOctalNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charOctalNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charOctalNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> charOctalNoZero # Digit1 :: Char -- '1' ---- --
-- >>> charOctalNoZero # Digit2 :: Char -- '2' ---- --
-- >>> charOctalNoZero # Digit3 :: Char -- '3' ---- --
-- >>> charOctalNoZero # Digit4 :: Char -- '4' ---- --
-- >>> charOctalNoZero # Digit5 :: Char -- '5' ---- --
-- >>> charOctalNoZero # Digit6 :: Char -- '6' ---- --
-- >>> charOctalNoZero # Digit7 :: Char -- '7' ---- --
-- \c -> (c `notElem` "1234567") ==> (c ^? charOctalNoZero == Nothing) --charOctalNoZero :: OctalNoZero d => Prism' Char d -- |
-- >>> '0' ^? charOctal :: Maybe Digit -- Just 0 ---- --
-- >>> '1' ^? charOctal :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charOctal :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charOctal :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charOctal :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charOctal :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charOctal :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charOctal :: Maybe Digit -- Just 7 ---- --
-- >>> charOctal # Digit0 :: Char -- '0' ---- --
-- >>> charOctal # Digit1 :: Char -- '1' ---- --
-- >>> charOctal # Digit2 :: Char -- '2' ---- --
-- >>> charOctal # Digit3 :: Char -- '3' ---- --
-- >>> charOctal # Digit4 :: Char -- '4' ---- --
-- >>> charOctal # Digit5 :: Char -- '5' ---- --
-- >>> charOctal # Digit6 :: Char -- '6' ---- --
-- >>> charOctal # Digit7 :: Char -- '7' ---- --
-- \c -> (c `notElem` "01234567") ==> (c ^? charOctal == Nothing) --charOctal :: Octal d => Prism' Char d -- |
-- >>> '1' ^? charDecimalNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charDecimalNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charDecimalNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charDecimalNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charDecimalNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charDecimalNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charDecimalNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charDecimalNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charDecimalNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> charDecimalNoZero # Digit1 :: Char -- '1' ---- --
-- >>> charDecimalNoZero # Digit2 :: Char -- '2' ---- --
-- >>> charDecimalNoZero # Digit3 :: Char -- '3' ---- --
-- >>> charDecimalNoZero # Digit4 :: Char -- '4' ---- --
-- >>> charDecimalNoZero # Digit5 :: Char -- '5' ---- --
-- >>> charDecimalNoZero # Digit6 :: Char -- '6' ---- --
-- >>> charDecimalNoZero # Digit7 :: Char -- '7' ---- --
-- >>> charDecimalNoZero # Digit8 :: Char -- '8' ---- --
-- >>> charDecimalNoZero # Digit9 :: Char -- '9' ---- --
-- \c -> (c `notElem` "123456789") ==> (c ^? charDecimalNoZero == Nothing) --charDecimalNoZero :: DecimalNoZero d => Prism' Char d -- |
-- >>> '0' ^? charDecimal :: Maybe Digit -- Just 0 ---- --
-- >>> '1' ^? charDecimal :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charDecimal :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charDecimal :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charDecimal :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charDecimal :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charDecimal :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charDecimal :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charDecimal :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charDecimal :: Maybe Digit -- Just 9 ---- --
-- >>> charDecimal # Digit0 :: Char -- '0' ---- --
-- >>> charDecimal # Digit1 :: Char -- '1' ---- --
-- >>> charDecimal # Digit2 :: Char -- '2' ---- --
-- >>> charDecimal # Digit3 :: Char -- '3' ---- --
-- >>> charDecimal # Digit4 :: Char -- '4' ---- --
-- >>> charDecimal # Digit5 :: Char -- '5' ---- --
-- >>> charDecimal # Digit6 :: Char -- '6' ---- --
-- >>> charDecimal # Digit7 :: Char -- '7' ---- --
-- >>> charDecimal # Digit8 :: Char -- '8' ---- --
-- >>> charDecimal # Digit9 :: Char -- '9' ---- --
-- \c -> (c `notElem` "0123456789") ==> (c ^? charDecimal == Nothing) --charDecimal :: Decimal d => Prism' Char d -- |
-- >>> '1' ^? charHexadecimalNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charHexadecimalNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charHexadecimalNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charHexadecimalNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charHexadecimalNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charHexadecimalNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charHexadecimalNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charHexadecimalNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charHexadecimalNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> 'a' ^? charHexadecimalNoZero :: Maybe Digit -- Just a ---- --
-- >>> 'b' ^? charHexadecimalNoZero :: Maybe Digit -- Just b ---- --
-- >>> 'c' ^? charHexadecimalNoZero :: Maybe Digit -- Just c ---- --
-- >>> 'd' ^? charHexadecimalNoZero :: Maybe Digit -- Just d ---- --
-- >>> 'e' ^? charHexadecimalNoZero :: Maybe Digit -- Just e ---- --
-- >>> 'f' ^? charHexadecimalNoZero :: Maybe Digit -- Just f ---- --
-- >>> charHexadecimalNoZero # Digit1 :: Char -- '1' ---- --
-- >>> charHexadecimalNoZero # Digit2 :: Char -- '2' ---- --
-- >>> charHexadecimalNoZero # Digit3 :: Char -- '3' ---- --
-- >>> charHexadecimalNoZero # Digit4 :: Char -- '4' ---- --
-- >>> charHexadecimalNoZero # Digit5 :: Char -- '5' ---- --
-- >>> charHexadecimalNoZero # Digit6 :: Char -- '6' ---- --
-- >>> charHexadecimalNoZero # Digit7 :: Char -- '7' ---- --
-- >>> charHexadecimalNoZero # Digit8 :: Char -- '8' ---- --
-- >>> charHexadecimalNoZero # Digit9 :: Char -- '9' ---- --
-- >>> charHexadecimalNoZero # Digita :: Char -- 'a' ---- --
-- >>> charHexadecimalNoZero # Digitb :: Char -- 'b' ---- --
-- >>> charHexadecimalNoZero # Digitc :: Char -- 'c' ---- --
-- >>> charHexadecimalNoZero # Digitd :: Char -- 'd' ---- --
-- >>> charHexadecimalNoZero # Digite :: Char -- 'e' ---- --
-- >>> charHexadecimalNoZero # Digitf :: Char -- 'f' ---- --
-- \c -> (c `notElem` "123456789abcdef") ==> (c ^? charHexadecimalNoZero == Nothing) --charHexadecimalNoZero :: HexadecimalNoZero d => Prism' Char d -- |
-- >>> '0' ^? charHexadecimal :: Maybe Digit -- Just 0 ---- --
-- >>> '1' ^? charHexadecimal :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charHexadecimal :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charHexadecimal :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charHexadecimal :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charHexadecimal :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charHexadecimal :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charHexadecimal :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charHexadecimal :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charHexadecimal :: Maybe Digit -- Just 9 ---- --
-- >>> 'a' ^? charHexadecimal :: Maybe Digit -- Just a ---- --
-- >>> 'b' ^? charHexadecimal :: Maybe Digit -- Just b ---- --
-- >>> 'c' ^? charHexadecimal :: Maybe Digit -- Just c ---- --
-- >>> 'd' ^? charHexadecimal :: Maybe Digit -- Just d ---- --
-- >>> 'e' ^? charHexadecimal :: Maybe Digit -- Just e ---- --
-- >>> 'f' ^? charHexadecimal :: Maybe Digit -- Just f ---- --
-- >>> charHexadecimal # Digit0 :: Char -- '0' ---- --
-- >>> charHexadecimal # Digit1 :: Char -- '1' ---- --
-- >>> charHexadecimal # Digit2 :: Char -- '2' ---- --
-- >>> charHexadecimal # Digit3 :: Char -- '3' ---- --
-- >>> charHexadecimal # Digit4 :: Char -- '4' ---- --
-- >>> charHexadecimal # Digit5 :: Char -- '5' ---- --
-- >>> charHexadecimal # Digit6 :: Char -- '6' ---- --
-- >>> charHexadecimal # Digit7 :: Char -- '7' ---- --
-- >>> charHexadecimal # Digit8 :: Char -- '8' ---- --
-- >>> charHexadecimal # Digit9 :: Char -- '9' ---- --
-- >>> charHexadecimal # Digita :: Char -- 'a' ---- --
-- >>> charHexadecimal # Digitb :: Char -- 'b' ---- --
-- >>> charHexadecimal # Digitc :: Char -- 'c' ---- --
-- >>> charHexadecimal # Digitd :: Char -- 'd' ---- --
-- >>> charHexadecimal # Digite :: Char -- 'e' ---- --
-- >>> charHexadecimal # Digitf :: Char -- 'f' ---- --
-- \c -> (c `notElem` "0123456789abcdef") ==> (c ^? charHexadecimal == Nothing) --charHexadecimal :: Hexadecimal d => Prism' Char d -- |
-- >>> '1' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> 'A' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just A ---- --
-- >>> 'B' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just B ---- --
-- >>> 'C' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just C ---- --
-- >>> 'D' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just D ---- --
-- >>> 'E' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just E ---- --
-- >>> 'F' ^? charHEXADECIMALNoZero :: Maybe Digit -- Just F ---- --
-- >>> charHEXADECIMALNoZero # Digit1 :: Char -- '1' ---- --
-- >>> charHEXADECIMALNoZero # Digit2 :: Char -- '2' ---- --
-- >>> charHEXADECIMALNoZero # Digit3 :: Char -- '3' ---- --
-- >>> charHEXADECIMALNoZero # Digit4 :: Char -- '4' ---- --
-- >>> charHEXADECIMALNoZero # Digit5 :: Char -- '5' ---- --
-- >>> charHEXADECIMALNoZero # Digit6 :: Char -- '6' ---- --
-- >>> charHEXADECIMALNoZero # Digit7 :: Char -- '7' ---- --
-- >>> charHEXADECIMALNoZero # Digit8 :: Char -- '8' ---- --
-- >>> charHEXADECIMALNoZero # Digit9 :: Char -- '9' ---- --
-- >>> charHEXADECIMALNoZero # DigitA :: Char -- 'A' ---- --
-- >>> charHEXADECIMALNoZero # DigitB :: Char -- 'B' ---- --
-- >>> charHEXADECIMALNoZero # DigitC :: Char -- 'C' ---- --
-- >>> charHEXADECIMALNoZero # DigitD :: Char -- 'D' ---- --
-- >>> charHEXADECIMALNoZero # DigitE :: Char -- 'E' ---- --
-- >>> charHEXADECIMALNoZero # DigitF :: Char -- 'F' ---- --
-- \c -> (c `notElem` "123456789ABCDEF") ==> (c ^? charHEXADECIMALNoZero == Nothing) --charHEXADECIMALNoZero :: HEXADECIMALNoZero d => Prism' Char d -- |
-- >>> '0' ^? charHEXADECIMAL :: Maybe Digit -- Just 0 ---- --
-- >>> '1' ^? charHEXADECIMAL :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charHEXADECIMAL :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charHEXADECIMAL :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charHEXADECIMAL :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charHEXADECIMAL :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charHEXADECIMAL :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charHEXADECIMAL :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charHEXADECIMAL :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charHEXADECIMAL :: Maybe Digit -- Just 9 ---- --
-- >>> 'A' ^? charHEXADECIMAL :: Maybe Digit -- Just A ---- --
-- >>> 'B' ^? charHEXADECIMAL :: Maybe Digit -- Just B ---- --
-- >>> 'C' ^? charHEXADECIMAL :: Maybe Digit -- Just C ---- --
-- >>> 'D' ^? charHEXADECIMAL :: Maybe Digit -- Just D ---- --
-- >>> 'E' ^? charHEXADECIMAL :: Maybe Digit -- Just E ---- --
-- >>> 'F' ^? charHEXADECIMAL :: Maybe Digit -- Just F ---- --
-- >>> charHEXADECIMAL # Digit0 :: Char -- '0' ---- --
-- >>> charHEXADECIMAL # Digit1 :: Char -- '1' ---- --
-- >>> charHEXADECIMAL # Digit2 :: Char -- '2' ---- --
-- >>> charHEXADECIMAL # Digit3 :: Char -- '3' ---- --
-- >>> charHEXADECIMAL # Digit4 :: Char -- '4' ---- --
-- >>> charHEXADECIMAL # Digit5 :: Char -- '5' ---- --
-- >>> charHEXADECIMAL # Digit6 :: Char -- '6' ---- --
-- >>> charHEXADECIMAL # Digit7 :: Char -- '7' ---- --
-- >>> charHEXADECIMAL # Digit8 :: Char -- '8' ---- --
-- >>> charHEXADECIMAL # Digit9 :: Char -- '9' ---- --
-- >>> charHEXADECIMAL # DigitA :: Char -- 'A' ---- --
-- >>> charHEXADECIMAL # DigitB :: Char -- 'B' ---- --
-- >>> charHEXADECIMAL # DigitC :: Char -- 'C' ---- --
-- >>> charHEXADECIMAL # DigitD :: Char -- 'D' ---- --
-- >>> charHEXADECIMAL # DigitE :: Char -- 'E' ---- --
-- >>> charHEXADECIMAL # DigitF :: Char -- 'F' ---- --
-- \c -> (c `notElem` "0123456789ABCDEF") ==> (c ^? charHEXADECIMAL == Nothing) --charHEXADECIMAL :: HEXADECIMAL d => Prism' Char d -- |
-- >>> '1' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just 9 ---- --
-- >>> 'a' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just a ---- --
-- >>> 'b' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just b ---- --
-- >>> 'c' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just c ---- --
-- >>> 'd' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just d ---- --
-- >>> 'e' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just e ---- --
-- >>> 'f' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just f ---- --
-- >>> 'A' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just A ---- --
-- >>> 'B' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just B ---- --
-- >>> 'C' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just C ---- --
-- >>> 'D' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just D ---- --
-- >>> 'E' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just E ---- --
-- >>> 'F' ^? charHeXaDeCiMaLNoZero :: Maybe Digit -- Just F ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit1 :: Char -- '1' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit2 :: Char -- '2' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit3 :: Char -- '3' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit4 :: Char -- '4' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit5 :: Char -- '5' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit6 :: Char -- '6' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit7 :: Char -- '7' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit8 :: Char -- '8' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digit9 :: Char -- '9' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digita :: Char -- 'a' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digitb :: Char -- 'b' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digitc :: Char -- 'c' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digitd :: Char -- 'd' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digite :: Char -- 'e' ---- --
-- >>> charHeXaDeCiMaLNoZero # Digitf :: Char -- 'f' ---- --
-- >>> charHeXaDeCiMaLNoZero # DigitA :: Char -- 'A' ---- --
-- >>> charHeXaDeCiMaLNoZero # DigitB :: Char -- 'B' ---- --
-- >>> charHeXaDeCiMaLNoZero # DigitC :: Char -- 'C' ---- --
-- >>> charHeXaDeCiMaLNoZero # DigitD :: Char -- 'D' ---- --
-- >>> charHeXaDeCiMaLNoZero # DigitE :: Char -- 'E' ---- --
-- >>> charHeXaDeCiMaLNoZero # DigitF :: Char -- 'F' ---- --
-- \c -> (c `notElem` "123456789abcdefABCDEF") ==> (c ^? charHeXaDeCiMaLNoZero == Nothing) --charHeXaDeCiMaLNoZero :: HeXaDeCiMaLNoZero d => Prism' Char d -- |
-- >>> '0' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 0 ---- --
-- >>> '1' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 1 ---- --
-- >>> '2' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 2 ---- --
-- >>> '3' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 3 ---- --
-- >>> '4' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 4 ---- --
-- >>> '5' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 5 ---- --
-- >>> '6' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 6 ---- --
-- >>> '7' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 7 ---- --
-- >>> '8' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 8 ---- --
-- >>> '9' ^? charHeXaDeCiMaL :: Maybe Digit -- Just 9 ---- --
-- >>> 'a' ^? charHeXaDeCiMaL :: Maybe Digit -- Just a ---- --
-- >>> 'b' ^? charHeXaDeCiMaL :: Maybe Digit -- Just b ---- --
-- >>> 'c' ^? charHeXaDeCiMaL :: Maybe Digit -- Just c ---- --
-- >>> 'd' ^? charHeXaDeCiMaL :: Maybe Digit -- Just d ---- --
-- >>> 'e' ^? charHeXaDeCiMaL :: Maybe Digit -- Just e ---- --
-- >>> 'f' ^? charHeXaDeCiMaL :: Maybe Digit -- Just f ---- --
-- >>> 'A' ^? charHeXaDeCiMaL :: Maybe Digit -- Just A ---- --
-- >>> 'B' ^? charHeXaDeCiMaL :: Maybe Digit -- Just B ---- --
-- >>> 'C' ^? charHeXaDeCiMaL :: Maybe Digit -- Just C ---- --
-- >>> 'D' ^? charHeXaDeCiMaL :: Maybe Digit -- Just D ---- --
-- >>> 'E' ^? charHeXaDeCiMaL :: Maybe Digit -- Just E ---- --
-- >>> 'F' ^? charHeXaDeCiMaL :: Maybe Digit -- Just F ---- --
-- >>> charHeXaDeCiMaL # Digit0 :: Char -- '0' ---- --
-- >>> charHeXaDeCiMaL # Digit1 :: Char -- '1' ---- --
-- >>> charHeXaDeCiMaL # Digit2 :: Char -- '2' ---- --
-- >>> charHeXaDeCiMaL # Digit3 :: Char -- '3' ---- --
-- >>> charHeXaDeCiMaL # Digit4 :: Char -- '4' ---- --
-- >>> charHeXaDeCiMaL # Digit5 :: Char -- '5' ---- --
-- >>> charHeXaDeCiMaL # Digit6 :: Char -- '6' ---- --
-- >>> charHeXaDeCiMaL # Digit7 :: Char -- '7' ---- --
-- >>> charHeXaDeCiMaL # Digit8 :: Char -- '8' ---- --
-- >>> charHeXaDeCiMaL # Digit9 :: Char -- '9' ---- --
-- >>> charHeXaDeCiMaL # Digita :: Char -- 'a' ---- --
-- >>> charHeXaDeCiMaL # Digitb :: Char -- 'b' ---- --
-- >>> charHeXaDeCiMaL # Digitc :: Char -- 'c' ---- --
-- >>> charHeXaDeCiMaL # Digitd :: Char -- 'd' ---- --
-- >>> charHeXaDeCiMaL # Digite :: Char -- 'e' ---- --
-- >>> charHeXaDeCiMaL # Digitf :: Char -- 'f' ---- --
-- >>> charHeXaDeCiMaL # DigitA :: Char -- 'A' ---- --
-- >>> charHeXaDeCiMaL # DigitB :: Char -- 'B' ---- --
-- >>> charHeXaDeCiMaL # DigitC :: Char -- 'C' ---- --
-- >>> charHeXaDeCiMaL # DigitD :: Char -- 'D' ---- --
-- >>> charHeXaDeCiMaL # DigitE :: Char -- 'E' ---- --
-- >>> charHeXaDeCiMaL # DigitF :: Char -- 'F' ---- --
-- \c -> (c `notElem` "0123456789abcdefABCDEF") ==> (c ^? charHeXaDeCiMaL == Nothing) --charHeXaDeCiMaL :: HeXaDeCiMaL d => Prism' Char d module Data.Digit