basement-0.0.11: 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 Source #

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

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

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

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

#### Instances

Instances details

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