basement-0.0.6: Foundation scrap box of array & string

Safe HaskellNone
LanguageHaskell2010

Basement.Numerical.Additive

Synopsis

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 #

Instances

Additive Double Source # 
Additive Float Source # 
Additive Int Source # 

Methods

azero :: Int Source #

(+) :: Int -> Int -> Int Source #

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

Additive Int8 Source # 

Methods

azero :: Int8 Source #

(+) :: Int8 -> Int8 -> Int8 Source #

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

Additive Int16 Source # 
Additive Int32 Source # 
Additive Int64 Source # 
Additive Integer Source # 
Additive Natural Source # 
Additive Word Source # 

Methods

azero :: Word Source #

(+) :: Word -> Word -> Word Source #

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

Additive Word8 Source # 
Additive Word16 Source # 
Additive Word32 Source # 
Additive Word64 Source # 
Additive COff Source # 

Methods

azero :: COff Source #

(+) :: COff -> COff -> COff Source #

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

Additive CChar Source # 
Additive CSChar Source # 
Additive CUChar Source # 
Additive CShort Source # 
Additive CUShort Source # 
Additive CInt Source # 

Methods

azero :: CInt Source #

(+) :: CInt -> CInt -> CInt Source #

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

Additive CUInt Source # 
Additive CLong Source # 
Additive CULong Source # 
Additive CLLong Source # 
Additive CULLong Source # 
Additive CFloat Source # 
Additive CDouble Source # 
Additive CPtrdiff Source # 
Additive CSize Source # 
Additive CWchar Source # 
Additive CSigAtomic Source # 
Additive CClock Source # 
Additive CTime Source # 
Additive CUSeconds Source # 
Additive CSUSeconds Source # 
Additive CIntPtr Source # 
Additive CUIntPtr Source # 
Additive CIntMax Source # 
Additive CUIntMax Source # 
Additive Word128 Source # 
Additive Word256 Source # 
KnownNat n => Additive (Zn n) Source # 

Methods

azero :: Zn n Source #

(+) :: Zn n -> Zn n -> Zn n Source #

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

(KnownNat n, NatWithinBound Word64 n) => Additive (Zn64 n) Source # 

Methods

azero :: Zn64 n Source #

(+) :: Zn64 n -> Zn64 n -> Zn64 n Source #

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

Additive (CountOf ty) Source # 

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 # 

Methods

azero :: Offset ty Source #

(+) :: Offset ty -> Offset ty -> Offset ty Source #

scale :: IsNatural n => n -> Offset ty -> Offset ty Source #