basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | Safe-Inferred
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 Source #

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 Source #

#### Instances

Instances details

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

class IsIntegral a => IsNatural a where Source #

Non Negative Number literals, convertible through the generic Natural type

Methods

toNatural :: a -> Natural Source #

#### Instances

Instances details

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