basement-0.0.12: Foundation scrap box of array & string
Safe HaskellNone
LanguageHaskell2010

Basement.Numerical.Multiplicative

Synopsis

Documentation

class Multiplicative a where #

Represent class of things that can be multiplied together

x * midentity = x
midentity * x = x

Minimal complete definition

midentity, (*)

Methods

midentity :: a #

Identity element over multiplication

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

Multiplication of 2 elements that result in another element

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

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 Double # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Double #

(*) :: Double -> Double -> Double #

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

Multiplicative Float # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Float #

(*) :: Float -> Float -> Float #

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

Multiplicative Int # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int #

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

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

Multiplicative Int8 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int8 #

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

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

Multiplicative Int16 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int16 #

(*) :: Int16 -> Int16 -> Int16 #

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

Multiplicative Int32 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int32 #

(*) :: Int32 -> Int32 -> Int32 #

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

Multiplicative Int64 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Int64 #

(*) :: Int64 -> Int64 -> Int64 #

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

Multiplicative Integer # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Natural # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Rational # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Word #

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

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

Multiplicative Word8 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Word8 #

(*) :: Word8 -> Word8 -> Word8 #

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

Multiplicative Word16 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Word16 #

(*) :: Word16 -> Word16 -> Word16 #

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

Multiplicative Word32 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Word32 #

(*) :: Word32 -> Word32 -> Word32 #

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

Multiplicative Word64 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: Word64 #

(*) :: Word64 -> Word64 -> Word64 #

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

Multiplicative COff # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: COff #

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

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

Multiplicative CChar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CChar #

(*) :: CChar -> CChar -> CChar #

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

Multiplicative CSChar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CSChar #

(*) :: CSChar -> CSChar -> CSChar #

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

Multiplicative CUChar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CUChar #

(*) :: CUChar -> CUChar -> CUChar #

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

Multiplicative CShort # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CShort #

(*) :: CShort -> CShort -> CShort #

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

Multiplicative CUShort # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CInt # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CInt #

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

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

Multiplicative CUInt # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CUInt #

(*) :: CUInt -> CUInt -> CUInt #

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

Multiplicative CLong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CLong #

(*) :: CLong -> CLong -> CLong #

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

Multiplicative CULong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CULong #

(*) :: CULong -> CULong -> CULong #

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

Multiplicative CLLong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CLLong #

(*) :: CLLong -> CLLong -> CLLong #

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

Multiplicative CULLong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CFloat # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CFloat #

(*) :: CFloat -> CFloat -> CFloat #

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

Multiplicative CDouble # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CPtrdiff # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CSize # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CSize #

(*) :: CSize -> CSize -> CSize #

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

Multiplicative CWchar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CWchar #

(*) :: CWchar -> CWchar -> CWchar #

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

Multiplicative CSigAtomic # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CClock # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CClock #

(*) :: CClock -> CClock -> CClock #

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

Multiplicative CTime # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

midentity :: CTime #

(*) :: CTime -> CTime -> CTime #

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

Multiplicative CUSeconds # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CSUSeconds # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CIntPtr # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUIntPtr # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CIntMax # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative CUIntMax # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word128 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Multiplicative Word256 # 
Instance details

Defined in Basement.Numerical.Multiplicative

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

Defined in Basement.Bits

Methods

midentity :: Bits n #

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

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

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

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 #

mod :: a -> a -> a #

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

Instances

Instances details
IDivisible Int # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int -> Int -> Int #

mod :: Int -> Int -> Int #

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

IDivisible Int8 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int8 -> Int8 -> Int8 #

mod :: Int8 -> Int8 -> Int8 #

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

IDivisible Int16 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int16 -> Int16 -> Int16 #

mod :: Int16 -> Int16 -> Int16 #

divMod :: Int16 -> Int16 -> (Int16, Int16) #

IDivisible Int32 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int32 -> Int32 -> Int32 #

mod :: Int32 -> Int32 -> Int32 #

divMod :: Int32 -> Int32 -> (Int32, Int32) #

IDivisible Int64 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Int64 -> Int64 -> Int64 #

mod :: Int64 -> Int64 -> Int64 #

divMod :: Int64 -> Int64 -> (Int64, Int64) #

IDivisible Integer # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Natural # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Word -> Word -> Word #

mod :: Word -> Word -> Word #

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

IDivisible Word8 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Word8 -> Word8 -> Word8 #

mod :: Word8 -> Word8 -> Word8 #

divMod :: Word8 -> Word8 -> (Word8, Word8) #

IDivisible Word16 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Word16 -> Word16 -> Word16 #

mod :: Word16 -> Word16 -> Word16 #

divMod :: Word16 -> Word16 -> (Word16, Word16) #

IDivisible Word32 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Word32 -> Word32 -> Word32 #

mod :: Word32 -> Word32 -> Word32 #

divMod :: Word32 -> Word32 -> (Word32, Word32) #

IDivisible Word64 # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: Word64 -> Word64 -> Word64 #

mod :: Word64 -> Word64 -> Word64 #

divMod :: Word64 -> Word64 -> (Word64, Word64) #

IDivisible CChar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CChar -> CChar -> CChar #

mod :: CChar -> CChar -> CChar #

divMod :: CChar -> CChar -> (CChar, CChar) #

IDivisible CSChar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CSChar -> CSChar -> CSChar #

mod :: CSChar -> CSChar -> CSChar #

divMod :: CSChar -> CSChar -> (CSChar, CSChar) #

IDivisible CUChar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CUChar -> CUChar -> CUChar #

mod :: CUChar -> CUChar -> CUChar #

divMod :: CUChar -> CUChar -> (CUChar, CUChar) #

IDivisible CShort # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CShort -> CShort -> CShort #

mod :: CShort -> CShort -> CShort #

divMod :: CShort -> CShort -> (CShort, CShort) #

IDivisible CUShort # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CInt # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CInt -> CInt -> CInt #

mod :: CInt -> CInt -> CInt #

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

IDivisible CUInt # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CUInt -> CUInt -> CUInt #

mod :: CUInt -> CUInt -> CUInt #

divMod :: CUInt -> CUInt -> (CUInt, CUInt) #

IDivisible CLong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CLong -> CLong -> CLong #

mod :: CLong -> CLong -> CLong #

divMod :: CLong -> CLong -> (CLong, CLong) #

IDivisible CULong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CULong -> CULong -> CULong #

mod :: CULong -> CULong -> CULong #

divMod :: CULong -> CULong -> (CULong, CULong) #

IDivisible CLLong # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CLLong -> CLLong -> CLLong #

mod :: CLLong -> CLLong -> CLLong #

divMod :: CLLong -> CLLong -> (CLLong, CLLong) #

IDivisible CULLong # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CPtrdiff # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CSize # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CSize -> CSize -> CSize #

mod :: CSize -> CSize -> CSize #

divMod :: CSize -> CSize -> (CSize, CSize) #

IDivisible CWchar # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

div :: CWchar -> CWchar -> CWchar #

mod :: CWchar -> CWchar -> CWchar #

divMod :: CWchar -> CWchar -> (CWchar, CWchar) #

IDivisible CSigAtomic # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CIntPtr # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUIntPtr # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CIntMax # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible CUIntMax # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word128 # 
Instance details

Defined in Basement.Numerical.Multiplicative

IDivisible Word256 # 
Instance details

Defined in Basement.Numerical.Multiplicative

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

Defined in Basement.Bits

Methods

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

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

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

class Multiplicative a => Divisible a where #

Support for division between same types

This is likely to change to represent specific mathematic divisions

Methods

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

Instances

Instances details
Divisible Double # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

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

Divisible Float # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

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

Divisible Rational # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

(/) :: Rational -> Rational -> Rational #

Divisible CFloat # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

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

Divisible CDouble # 
Instance details

Defined in Basement.Numerical.Multiplicative

Methods

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

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