basement-0.0.16: Foundation scrap box of array & string
Safe HaskellSafe-Inferred
LanguageHaskell2010

Basement.Numerical.Multiplicative

Synopsis

Documentation

class Multiplicative a where Source #

Represent class of things that can be multiplied together

x * midentity = x
midentity * x = x

Minimal complete definition

midentity, (*)

Methods

midentity :: a Source #

Identity element over multiplication

(*) :: a -> a -> a infixl 7 Source #

Multiplication of 2 elements that result in another element

(^) :: (IsNatural n, Enum n, IDivisible n) => a -> n -> a infixr 8 Source #

Raise to power, repeated multiplication e.g. > a ^ 2 = a * a > a ^ 10 = (a ^ 5) * (a ^ 5) .. (^) :: (IsNatural n) => a -> n -> a

Instances

Instances details
Multiplicative CChar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CClock Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CDouble Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CFloat Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CInt Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CInt Source #

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

(^) :: (IsNatural n, Enum n, IDivisible n) => CInt -> n -> CInt Source #

Multiplicative CIntMax Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CIntPtr Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CLLong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CLong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CPtrdiff Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CSChar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CSUSeconds Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CShort Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CSigAtomic Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CSize Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CTime Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUChar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUInt Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUIntMax Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUIntPtr Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CULLong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CULong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUSeconds Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUShort Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CWchar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Int16 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Int32 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Int64 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Int8 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int8 Source #

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

(^) :: (IsNatural n, Enum n, IDivisible n) => Int8 -> n -> Int8 Source #

Multiplicative Rational Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word16 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word32 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word64 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word8 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative COff Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: COff Source #

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

(^) :: (IsNatural n, Enum n, IDivisible n) => COff -> n -> COff Source #

Multiplicative Word128 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word256 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Integer Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Natural Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Double Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Float Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Int Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int Source #

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

(^) :: (IsNatural n, Enum n, IDivisible n) => Int -> n -> Int Source #

Multiplicative Word Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Word Source #

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

(^) :: (IsNatural n, Enum n, IDivisible n) => Word -> n -> Word Source #

SizeValid n => Multiplicative (Bits n) Source # 
Instance details

Defined in Basement.Bits

Methods

midentity :: Bits n Source #

(*) :: Bits n -> Bits n -> Bits n Source #

(^) :: (IsNatural n0, Enum n0, IDivisible n0) => Bits n -> n0 -> Bits n Source #

class (Additive a, Multiplicative a) => IDivisible a where Source #

Represent types that supports an euclidian division

(x ‘div‘ y) * y + (x ‘mod‘ y) == x

Minimal complete definition

div, mod | divMod

Methods

div :: a -> a -> a Source #

mod :: a -> a -> a Source #

divMod :: a -> a -> (a, a) Source #

Instances

Instances details
IDivisible CChar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CInt Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CInt -> CInt -> CInt Source #

mod :: CInt -> CInt -> CInt Source #

divMod :: CInt -> CInt -> (CInt, CInt) Source #

IDivisible CIntMax Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CIntPtr Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CLLong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CLong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CPtrdiff Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CSChar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CShort Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CSigAtomic Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CSize Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUChar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUInt Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUIntMax Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUIntPtr Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CULLong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CULong Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUShort Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CWchar Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Int16 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Int32 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Int64 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Int8 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int8 -> Int8 -> Int8 Source #

mod :: Int8 -> Int8 -> Int8 Source #

divMod :: Int8 -> Int8 -> (Int8, Int8) Source #

IDivisible Word16 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word32 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word64 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word8 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word128 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word256 Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Integer Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Natural Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Int Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int -> Int -> Int Source #

mod :: Int -> Int -> Int Source #

divMod :: Int -> Int -> (Int, Int) Source #

IDivisible Word Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Word -> Word -> Word Source #

mod :: Word -> Word -> Word Source #

divMod :: Word -> Word -> (Word, Word) Source #

SizeValid n => IDivisible (Bits n) Source # 
Instance details

Defined in Basement.Bits

Methods

div :: Bits n -> Bits n -> Bits n Source #

mod :: Bits n -> Bits n -> Bits n Source #

divMod :: Bits n -> Bits n -> (Bits n, Bits n) Source #

class Multiplicative a => Divisible a where Source #

Support for division between same types

This is likely to change to represent specific mathematic divisions

Methods

(/) :: a -> a -> a infixl 7 Source #

Instances

Instances details
Divisible CDouble Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

(/) :: CDouble -> CDouble -> CDouble Source #

Divisible CFloat Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

(/) :: CFloat -> CFloat -> CFloat Source #

Divisible Rational Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Divisible Double Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

(/) :: Double -> Double -> Double Source #

Divisible Float Source # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

(/) :: Float -> Float -> Float Source #

recip :: Divisible a => a -> a Source #