basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | None
Language | Haskell2010

Basement.Numerical.Additive

Synopsis

- class Additive a where
  - azero :: a
  - (+) :: a -> a -> a
  - scale :: IsNatural n => n -> a -> a

# Documentation

class Additive a where #

Represent class of things that can be added together, contains a neutral element and is commutative.

    x + azero = x
    azero + x = x
    x + y = y + x

Minimal complete definition

azero, (+)

Methods

azero :: a #

(+) :: a -> a -> a infixl 6 #

scale :: IsNatural n => n -> a -> a #

default scale :: (Enum n, IsNatural n) => n -> a -> a #

#### Instances

Instances details

Additive Word128 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word128 # (+) :: Word128 -> Word128 -> Word128 # scale :: IsNatural n => n -> Word128 -> Word128 #
Additive Word256 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word256 # (+) :: Word256 -> Word256 -> Word256 # scale :: IsNatural n => n -> Word256 -> Word256 #
Additive CChar # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CChar # (+) :: CChar -> CChar -> CChar # scale :: IsNatural n => n -> CChar -> CChar #
Additive CClock # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CClock # (+) :: CClock -> CClock -> CClock # scale :: IsNatural n => n -> CClock -> CClock #
Additive CDouble # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CDouble # (+) :: CDouble -> CDouble -> CDouble # scale :: IsNatural n => n -> CDouble -> CDouble #
Additive CFloat # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CFloat # (+) :: CFloat -> CFloat -> CFloat # scale :: IsNatural n => n -> CFloat -> CFloat #
Additive CInt # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CInt # (+) :: CInt -> CInt -> CInt # scale :: IsNatural n => n -> CInt -> CInt #
Additive CIntMax # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CIntMax # (+) :: CIntMax -> CIntMax -> CIntMax # scale :: IsNatural n => n -> CIntMax -> CIntMax #
Additive CIntPtr # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CIntPtr # (+) :: CIntPtr -> CIntPtr -> CIntPtr # scale :: IsNatural n => n -> CIntPtr -> CIntPtr #
Additive CLLong # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CLLong # (+) :: CLLong -> CLLong -> CLLong # scale :: IsNatural n => n -> CLLong -> CLLong #
Additive CLong # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CLong # (+) :: CLong -> CLong -> CLong # scale :: IsNatural n => n -> CLong -> CLong #
Additive CPtrdiff # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CPtrdiff # (+) :: CPtrdiff -> CPtrdiff -> CPtrdiff # scale :: IsNatural n => n -> CPtrdiff -> CPtrdiff #
Additive CSChar # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CSChar # (+) :: CSChar -> CSChar -> CSChar # scale :: IsNatural n => n -> CSChar -> CSChar #
Additive CSUSeconds # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CSUSeconds # (+) :: CSUSeconds -> CSUSeconds -> CSUSeconds # scale :: IsNatural n => n -> CSUSeconds -> CSUSeconds #
Additive CShort # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CShort # (+) :: CShort -> CShort -> CShort # scale :: IsNatural n => n -> CShort -> CShort #
Additive CSigAtomic # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CSigAtomic # (+) :: CSigAtomic -> CSigAtomic -> CSigAtomic # scale :: IsNatural n => n -> CSigAtomic -> CSigAtomic #
Additive CSize # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CSize # (+) :: CSize -> CSize -> CSize # scale :: IsNatural n => n -> CSize -> CSize #
Additive CTime # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CTime # (+) :: CTime -> CTime -> CTime # scale :: IsNatural n => n -> CTime -> CTime #
Additive CUChar # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CUChar # (+) :: CUChar -> CUChar -> CUChar # scale :: IsNatural n => n -> CUChar -> CUChar #
Additive CUInt # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CUInt # (+) :: CUInt -> CUInt -> CUInt # scale :: IsNatural n => n -> CUInt -> CUInt #
Additive CUIntMax # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CUIntMax # (+) :: CUIntMax -> CUIntMax -> CUIntMax # scale :: IsNatural n => n -> CUIntMax -> CUIntMax #
Additive CUIntPtr # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CUIntPtr # (+) :: CUIntPtr -> CUIntPtr -> CUIntPtr # scale :: IsNatural n => n -> CUIntPtr -> CUIntPtr #
Additive CULLong # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CULLong # (+) :: CULLong -> CULLong -> CULLong # scale :: IsNatural n => n -> CULLong -> CULLong #
Additive CULong # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CULong # (+) :: CULong -> CULong -> CULong # scale :: IsNatural n => n -> CULong -> CULong #
Additive CUSeconds # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CUSeconds # (+) :: CUSeconds -> CUSeconds -> CUSeconds # scale :: IsNatural n => n -> CUSeconds -> CUSeconds #
Additive CUShort # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CUShort # (+) :: CUShort -> CUShort -> CUShort # scale :: IsNatural n => n -> CUShort -> CUShort #
Additive CWchar # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: CWchar # (+) :: CWchar -> CWchar -> CWchar # scale :: IsNatural n => n -> CWchar -> CWchar #
Additive Int16 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Int16 # (+) :: Int16 -> Int16 -> Int16 # scale :: IsNatural n => n -> Int16 -> Int16 #
Additive Int32 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Int32 # (+) :: Int32 -> Int32 -> Int32 # scale :: IsNatural n => n -> Int32 -> Int32 #
Additive Int64 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Int64 # (+) :: Int64 -> Int64 -> Int64 # scale :: IsNatural n => n -> Int64 -> Int64 #
Additive Int8 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Int8 # (+) :: Int8 -> Int8 -> Int8 # scale :: IsNatural n => n -> Int8 -> Int8 #
Additive Rational # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Rational # (+) :: Rational -> Rational -> Rational # scale :: IsNatural n => n -> Rational -> Rational #
Additive COff # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: COff # (+) :: COff -> COff -> COff # scale :: IsNatural n => n -> COff -> COff #
Additive Word16 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word16 # (+) :: Word16 -> Word16 -> Word16 # scale :: IsNatural n => n -> Word16 -> Word16 #
Additive Word32 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word32 # (+) :: Word32 -> Word32 -> Word32 # scale :: IsNatural n => n -> Word32 -> Word32 #
Additive Word64 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word64 # (+) :: Word64 -> Word64 -> Word64 # scale :: IsNatural n => n -> Word64 -> Word64 #
Additive Word8 # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word8 # (+) :: Word8 -> Word8 -> Word8 # scale :: IsNatural n => n -> Word8 -> Word8 #
Additive Integer # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Integer # (+) :: Integer -> Integer -> Integer # scale :: IsNatural n => n -> Integer -> Integer #
Additive Natural # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Natural # (+) :: Natural -> Natural -> Natural # scale :: IsNatural n => n -> Natural -> Natural #
Additive Double # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Double # (+) :: Double -> Double -> Double # scale :: IsNatural n => n -> Double -> Double #
Additive Float # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Float # (+) :: Float -> Float -> Float # scale :: IsNatural n => n -> Float -> Float #
Additive Int # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Int # (+) :: Int -> Int -> Int # scale :: IsNatural n => n -> Int -> Int #
Additive Word # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word # (+) :: Word -> Word -> Word # scale :: IsNatural n => n -> Word -> Word #
SizeValid n => Additive (Bits n) # |
Instance details Defined in Basement.Bits Methods azero :: Bits n # (+) :: Bits n -> Bits n -> Bits n # scale :: IsNatural n0 => n0 -> Bits n -> Bits n #
KnownNat n => Additive (Zn n) # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Zn n # (+) :: Zn n -> Zn n -> Zn n # scale :: IsNatural n0 => n0 -> Zn n -> Zn n #
(KnownNat n, NatWithinBound Word64 n) => Additive (Zn64 n) # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Zn64 n # (+) :: Zn64 n -> Zn64 n -> Zn64 n # scale :: IsNatural n0 => n0 -> Zn64 n -> Zn64 n #
Additive (CountOf ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods azero :: CountOf ty # (+) :: CountOf ty -> CountOf ty -> CountOf ty # scale :: IsNatural n => n -> CountOf ty -> CountOf ty #
Additive (Offset ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods azero :: Offset ty # (+) :: Offset ty -> Offset ty -> Offset ty # scale :: IsNatural n => n -> Offset ty -> Offset ty #