basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | None
Language | Haskell2010

Basement.Numerical.Number

Synopsis

- class (Integral a, Eq a, Ord a) => IsIntegral a where
  - toInteger :: a -> Integer
- class IsIntegral a => IsNatural a where
  - toNatural :: a -> Natural

# Documentation

class (Integral a, Eq a, Ord a) => IsIntegral a where #

Number literals, convertible through the generic Integer type.

all number are Enum'erable, meaning that you can move to next element

Methods

toInteger :: a -> Integer #

#### Instances

Instances details

IsIntegral Word128 # |
Instance details Defined in Basement.Types.Word128 Methods toInteger :: Word128 -> Integer #
IsIntegral Word256 # |
Instance details Defined in Basement.Types.Word256 Methods toInteger :: Word256 -> Integer #
IsIntegral CBool # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CBool -> Integer #
IsIntegral CChar # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CChar -> Integer #
IsIntegral CInt # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CInt -> Integer #
IsIntegral CIntMax # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CIntMax -> Integer #
IsIntegral CIntPtr # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CIntPtr -> Integer #
IsIntegral CLLong # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CLLong -> Integer #
IsIntegral CLong # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CLong -> Integer #
IsIntegral CPtrdiff # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CPtrdiff -> Integer #
IsIntegral CSChar # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CSChar -> Integer #
IsIntegral CShort # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CShort -> Integer #
IsIntegral CSigAtomic # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CSigAtomic -> Integer #
IsIntegral CSize # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CSize -> Integer #
IsIntegral CUChar # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CUChar -> Integer #
IsIntegral CUInt # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CUInt -> Integer #
IsIntegral CUIntMax # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CUIntMax -> Integer #
IsIntegral CUIntPtr # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CUIntPtr -> Integer #
IsIntegral CULLong # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CULLong -> Integer #
IsIntegral CULong # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CULong -> Integer #
IsIntegral CUShort # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CUShort -> Integer #
IsIntegral CWchar # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: CWchar -> Integer #
IsIntegral Int16 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Int16 -> Integer #
IsIntegral Int32 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Int32 -> Integer #
IsIntegral Int64 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Int64 -> Integer #
IsIntegral Int8 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Int8 -> Integer #
IsIntegral Word16 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word16 -> Integer #
IsIntegral Word32 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word32 -> Integer #
IsIntegral Word64 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word64 -> Integer #
IsIntegral Word8 # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word8 -> Integer #
IsIntegral Integer # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Integer -> Integer #
IsIntegral Natural # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Natural -> Integer #
IsIntegral Int # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Int -> Integer #
IsIntegral Word # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word -> Integer #
KnownNat n => IsIntegral (Zn n) # |
Instance details Defined in Basement.Bounded Methods toInteger :: Zn n -> Integer #
(KnownNat n, NatWithinBound Word64 n) => IsIntegral (Zn64 n) # |
Instance details Defined in Basement.Bounded Methods toInteger :: Zn64 n -> Integer #
IsIntegral (CountOf ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods toInteger :: CountOf ty -> Integer #
IsIntegral (Offset ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods toInteger :: Offset ty -> Integer #

class IsIntegral a => IsNatural a where #

Non Negative Number literals, convertible through the generic Natural type

Methods

toNatural :: a -> Natural #

#### Instances

Instances details

IsNatural Word128 # |
Instance details Defined in Basement.Types.Word128 Methods toNatural :: Word128 -> Natural #
IsNatural Word256 # |
Instance details Defined in Basement.Types.Word256 Methods toNatural :: Word256 -> Natural #
IsNatural CSize # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CSize -> Natural #
IsNatural CUChar # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CUChar -> Natural #
IsNatural CUInt # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CUInt -> Natural #
IsNatural CUIntMax # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CUIntMax -> Natural #
IsNatural CUIntPtr # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CUIntPtr -> Natural #
IsNatural CULLong # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CULLong -> Natural #
IsNatural CULong # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CULong -> Natural #
IsNatural CUShort # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: CUShort -> Natural #
IsNatural Word16 # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word16 -> Natural #
IsNatural Word32 # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word32 -> Natural #
IsNatural Word64 # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word64 -> Natural #
IsNatural Word8 # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word8 -> Natural #
IsNatural Natural # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Natural -> Natural #
IsNatural Word # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word -> Natural #
KnownNat n => IsNatural (Zn n) # |
Instance details Defined in Basement.Bounded Methods toNatural :: Zn n -> Natural #
(KnownNat n, NatWithinBound Word64 n) => IsNatural (Zn64 n) # |
Instance details Defined in Basement.Bounded Methods toNatural :: Zn64 n -> Natural #
IsNatural (CountOf ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods toNatural :: CountOf ty -> Natural #
IsNatural (Offset ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods toNatural :: Offset ty -> Natural #