| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Data.Digit.Integral
Synopsis
- integralBinaryNoZero :: (Integral a, BinaryNoZero d) => Prism' a d
- integralBinary :: (Integral a, Binary d) => Prism' a d
- integralBinDigits :: Integral a => a -> Either (NonEmpty BinDigit) (NonEmpty BinDigit)
- binDigitsIntegral :: Integral a => Either (NonEmpty BinDigit) (NonEmpty BinDigit) -> a
- integralOctalNoZero :: (Integral a, OctalNoZero d) => Prism' a d
- integralOctal :: (Integral a, Octal d) => Prism' a d
- integralOctDigits :: Integral a => a -> Either (NonEmpty OctDigit) (NonEmpty OctDigit)
- octDigitsIntegral :: Integral a => Either (NonEmpty OctDigit) (NonEmpty OctDigit) -> a
- integralDecimal :: (Integral a, Decimal d) => Prism' a d
- integralDecimalNoZero :: (Integral a, DecimalNoZero d) => Prism' a d
- integralDecDigits :: Integral a => a -> Either (NonEmpty DecDigit) (NonEmpty DecDigit)
- decDigitsIntegral :: Integral a => Either (NonEmpty DecDigit) (NonEmpty DecDigit) -> a
- integralHexadecimalNoZero :: (Integral a, HexadecimalNoZero d) => Prism' a d
- integralHexadecimal :: (Integral a, Hexadecimal d) => Prism' a d
- integralHexDigits :: Integral a => a -> Either (NonEmpty HexDigit) (NonEmpty HexDigit)
- hexDigitsIntegral :: Integral a => Either (NonEmpty HexDigit) (NonEmpty HexDigit) -> a
- integralHEXADECIMALNoZero :: (Integral a, HEXADECIMALNoZero d) => Prism' a d
- integralHEXADECIMAL :: (Integral a, HEXADECIMAL d) => Prism' a d
- integralHEXDigits :: Integral a => a -> Either (NonEmpty HEXDigit) (NonEmpty HEXDigit)
- _HEXDigitsIntegral :: Integral a => Either (NonEmpty HEXDigit) (NonEmpty HEXDigit) -> a
- integralHeXaDeCiMaLNoZero :: (Integral a, HeXaDeCiMaLNoZero d) => Review a d
- integralHeXaDeCiMaL :: (Integral a, HeXaDeCiMaL d) => Review a d
- _HeXDigitsIntegral :: Integral a => Either (NonEmpty HeXDigit) (NonEmpty HeXDigit) -> a
- mod10 :: Integral a => a -> DecDigit
- addDecDigit :: DecDigit -> DecDigit -> (Bool, DecDigit)
- addDecDigit' :: DecDigit -> DecDigit -> (DecDigit, DecDigit)
Binary
integralBinaryNoZero :: (Integral a, BinaryNoZero d) => Prism' a d Source #
>>>1 ^? integralBinaryNoZeroJust BinDigit1
>>>integralBinaryNoZero # BinDigit1 :: Integer1
integralBinary :: (Integral a, Binary d) => Prism' a d Source #
>>>0 ^? integralBinary :: Maybe BinDigitJust BinDigit0
>>>integralBinary # BinDigit0 :: Integer0
integralBinDigits :: Integral a => a -> Either (NonEmpty BinDigit) (NonEmpty BinDigit) Source #
>>>integralBinDigits (4 :: Int)Right (BinDigit1 :| [BinDigit0, BinDigit0])
>>>integralBinDigits (0 :: Int)Right (BinDigit0 :| [])
>>>integralBinDigits (-1 :: Int)Left (BinDigit0 :| [])
>>>integralBinDigits (-4 :: Int)Left (BinDigit1 :| [BinDigit1])
binDigitsIntegral :: Integral a => Either (NonEmpty BinDigit) (NonEmpty BinDigit) -> a Source #
>>>binDigitsIntegral (Right (BinDigit1 :| [BinDigit0, BinDigit0])) :: Int4
>>>binDigitsIntegral (Right (BinDigit0 :| [])) :: Int0
>>>binDigitsIntegral (Left (BinDigit0 :| [])) :: Int-1
>>>binDigitsIntegral (Left (BinDigit1 :| [BinDigit1])) :: Int-4
Octal
integralOctalNoZero :: (Integral a, OctalNoZero d) => Prism' a d Source #
>>>7 ^? integralOctalNoZero :: Maybe OctDigitJust OctDigit7
>>>integralOctalNoZero # OctDigit7 :: Integer7
integralOctal :: (Integral a, Octal d) => Prism' a d Source #
>>>7 ^? integralOctal :: Maybe OctDigitJust OctDigit7
>>>integralOctal # OctDigit7 :: Integer7
integralOctDigits :: Integral a => a -> Either (NonEmpty OctDigit) (NonEmpty OctDigit) Source #
>>>integralOctDigits (64 :: Int)Right (OctDigit1 :| [OctDigit0, OctDigit0])
>>>integralOctDigits (0 :: Int)Right (OctDigit0 :| [])
>>>integralOctDigits (-1 :: Int)Left (OctDigit0 :| [])
>>>integralOctDigits (-64 :: Int)Left (OctDigit7 :| [OctDigit7])
octDigitsIntegral :: Integral a => Either (NonEmpty OctDigit) (NonEmpty OctDigit) -> a Source #
>>>octDigitsIntegral (Right (OctDigit1 :| [OctDigit0, OctDigit0])) :: Int64
>>>octDigitsIntegral (Right (OctDigit0 :| [])) :: Int0
>>>octDigitsIntegral (Left (OctDigit0 :| [])) :: Int-1
>>>octDigitsIntegral (Left (OctDigit7 :| [OctDigit7])) :: Int-64
Decimal
integralDecimal :: (Integral a, Decimal d) => Prism' a d Source #
>>>9 ^? integralDecimal :: Maybe DecDigitJust DecDigit9
>>>integralDecimal # DecDigit9 :: Integer9
integralDecimalNoZero :: (Integral a, DecimalNoZero d) => Prism' a d Source #
>>>9 ^? integralDecimalNoZero :: Maybe DecDigitJust DecDigit9
>>>integralDecimalNoZero # DecDigit9 :: Integer9
integralDecDigits :: Integral a => a -> Either (NonEmpty DecDigit) (NonEmpty DecDigit) Source #
>>>integralDecDigits (100 :: Int)Right (DecDigit1 :| [DecDigit0, DecDigit0])
>>>integralDecDigits (0 :: Int)Right (DecDigit0 :| [])
>>>integralDecDigits (-1 :: Int)Left (DecDigit0 :| [])
>>>integralDecDigits (-100 :: Int)Left (DecDigit9 :| [DecDigit9])
decDigitsIntegral :: Integral a => Either (NonEmpty DecDigit) (NonEmpty DecDigit) -> a Source #
>>>decDigitsIntegral (Right (DecDigit1 :| [DecDigit0, DecDigit0])) :: Int100
>>>decDigitsIntegral (Right (DecDigit0 :| [])) :: Int0
>>>decDigitsIntegral (Left (DecDigit0 :| [])) :: Int-1
>>>decDigitsIntegral (Left (DecDigit9 :| [DecDigit9])) :: Int-100
Hexadecimal
integralHexadecimalNoZero :: (Integral a, HexadecimalNoZero d) => Prism' a d Source #
>>>15 ^? integralHexadecimalNoZero :: Maybe HexDigitJust HexDigitf
>>>integralHexadecimalNoZero # HexDigitf :: Integer15
integralHexadecimal :: (Integral a, Hexadecimal d) => Prism' a d Source #
>>>15 ^? integralHexadecimal :: Maybe HexDigitJust HexDigitf
>>>integralHexadecimal # HexDigitf :: Integer15
integralHexDigits :: Integral a => a -> Either (NonEmpty HexDigit) (NonEmpty HexDigit) Source #
>>>integralHexDigits (256 :: Int)Right (HexDigit1 :| [HexDigit0, HexDigit0])
>>>integralHexDigits (0 :: Int)Right (HexDigit0 :| [])
>>>integralHexDigits (-1 :: Int)Left (HexDigit0 :| [])
>>>integralHexDigits (-256 :: Int)Left (HexDigitf :| [HexDigitf])
hexDigitsIntegral :: Integral a => Either (NonEmpty HexDigit) (NonEmpty HexDigit) -> a Source #
>>>hexDigitsIntegral (Right (HexDigit1 :| [HexDigit0, HexDigit0])) :: Int256
>>>hexDigitsIntegral (Right (HexDigit0 :| [])) :: Int0
>>>hexDigitsIntegral (Left (HexDigit0 :| [])) :: Int-1
>>>hexDigitsIntegral (Left (HexDigitf :| [HexDigitf])) :: Int-256
HEXADECIMAL
integralHEXADECIMALNoZero :: (Integral a, HEXADECIMALNoZero d) => Prism' a d Source #
>>>15 ^? integralHEXADECIMALNoZero :: Maybe HEXDigitJust HEXDigitF
>>>integralHEXADECIMALNoZero # HEXDigitF :: Integer15
integralHEXADECIMAL :: (Integral a, HEXADECIMAL d) => Prism' a d Source #
>>>15 ^? integralHEXADECIMAL :: Maybe HEXDigitJust HEXDigitF
>>>integralHEXADECIMAL # HEXDigitF :: Integer15
integralHEXDigits :: Integral a => a -> Either (NonEmpty HEXDigit) (NonEmpty HEXDigit) Source #
>>>integralHEXDigits (256 :: Int)Right (HEXDigit1 :| [HEXDigit0, HEXDigit0])
>>>integralHEXDigits (0 :: Int)Right (HEXDigit0 :| [])
>>>integralHEXDigits (-1 :: Int)Left (HEXDigit0 :| [])
>>>integralHEXDigits (-256 :: Int)Left (HEXDigitF :| [HEXDigitF])
_HEXDigitsIntegral :: Integral a => Either (NonEmpty HEXDigit) (NonEmpty HEXDigit) -> a Source #
>>>HEXDigitsIntegral (Right (HEXDigit1 :| [HEXDigit0, HEXDigit0])) :: Int256
>>>HEXDigitsIntegral (Right (HEXDigit0 :| [])) :: Int0
>>>HEXDigitsIntegral (Left (HEXDigit0 :| [])) :: Int-1
>>>HEXDigitsIntegral (Left (HEXDigitF :| [HEXDigitF])) :: Int-256
HeXaDeCiMaL
integralHeXaDeCiMaLNoZero :: (Integral a, HeXaDeCiMaLNoZero d) => Review a d Source #
>>>15 ^? integralHeXaDeCiMaLNoZero :: Maybe HeXDigitJust HeXDigitF
>>>integralHeXaDeCiMaLNoZero # HeXDigitF :: Integer15
integralHeXaDeCiMaL :: (Integral a, HeXaDeCiMaL d) => Review a d Source #
>>>15 ^? integralHeXaDeCiMaL :: Maybe HeXDigitJust HeXDigitF
>>>integralHeXaDeCiMaL # HeXDigitF :: Integer15
_HeXDigitsIntegral :: Integral a => Either (NonEmpty HeXDigit) (NonEmpty HeXDigit) -> a Source #
>>>HeXDigitsIntegral (Right (HeXDigit1 :| [HeXDigit0, HeXDigit0])) :: Int256
>>>HeXDigitsIntegral (Right (HeXDigit0 :| [])) :: Int0
>>>HeXDigitsIntegral (Left (HeXDigit0 :| [])) :: Int-1
>>>HeXDigitsIntegral (Left (HeXDigitF :| [HeXDigitF])) :: Int-256