basement-0.0.10: Foundation scrap box of array & string

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

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
 # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Double -> Double -> Double #(^) :: (IsNatural n, Enum n, IDivisible n) => Double -> n -> Double # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Float -> Float -> Float #(^) :: (IsNatural n, Enum n, IDivisible n) => Float -> n -> Float # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Int -> Int -> Int #(^) :: (IsNatural n, Enum n, IDivisible n) => Int -> n -> Int # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Int8 -> Int8 -> Int8 #(^) :: (IsNatural n, Enum n, IDivisible n) => Int8 -> n -> Int8 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Int16 -> Int16 -> Int16 #(^) :: (IsNatural n, Enum n, IDivisible n) => Int16 -> n -> Int16 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Int32 -> Int32 -> Int32 #(^) :: (IsNatural n, Enum n, IDivisible n) => Int32 -> n -> Int32 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Int64 -> Int64 -> Int64 #(^) :: (IsNatural n, Enum n, IDivisible n) => Int64 -> n -> Int64 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => Integer -> n -> Integer # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => Natural -> n -> Natural # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => Rational -> n -> Rational # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Word -> Word -> Word #(^) :: (IsNatural n, Enum n, IDivisible n) => Word -> n -> Word # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Word8 -> Word8 -> Word8 #(^) :: (IsNatural n, Enum n, IDivisible n) => Word8 -> n -> Word8 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Word16 -> Word16 -> Word16 #(^) :: (IsNatural n, Enum n, IDivisible n) => Word16 -> n -> Word16 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Word32 -> Word32 -> Word32 #(^) :: (IsNatural n, Enum n, IDivisible n) => Word32 -> n -> Word32 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: Word64 -> Word64 -> Word64 #(^) :: (IsNatural n, Enum n, IDivisible n) => Word64 -> n -> Word64 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: COff -> COff -> COff #(^) :: (IsNatural n, Enum n, IDivisible n) => COff -> n -> COff # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CChar -> CChar -> CChar #(^) :: (IsNatural n, Enum n, IDivisible n) => CChar -> n -> CChar # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CSChar -> CSChar -> CSChar #(^) :: (IsNatural n, Enum n, IDivisible n) => CSChar -> n -> CSChar # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CUChar -> CUChar -> CUChar #(^) :: (IsNatural n, Enum n, IDivisible n) => CUChar -> n -> CUChar # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CShort -> CShort -> CShort #(^) :: (IsNatural n, Enum n, IDivisible n) => CShort -> n -> CShort # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CUShort -> n -> CUShort # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CInt -> CInt -> CInt #(^) :: (IsNatural n, Enum n, IDivisible n) => CInt -> n -> CInt # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CUInt -> CUInt -> CUInt #(^) :: (IsNatural n, Enum n, IDivisible n) => CUInt -> n -> CUInt # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CLong -> CLong -> CLong #(^) :: (IsNatural n, Enum n, IDivisible n) => CLong -> n -> CLong # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CULong -> CULong -> CULong #(^) :: (IsNatural n, Enum n, IDivisible n) => CULong -> n -> CULong # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CLLong -> CLLong -> CLLong #(^) :: (IsNatural n, Enum n, IDivisible n) => CLLong -> n -> CLLong # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CULLong -> n -> CULLong # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CFloat -> CFloat -> CFloat #(^) :: (IsNatural n, Enum n, IDivisible n) => CFloat -> n -> CFloat # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CDouble -> n -> CDouble # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CPtrdiff -> n -> CPtrdiff # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CSize -> CSize -> CSize #(^) :: (IsNatural n, Enum n, IDivisible n) => CSize -> n -> CSize # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CWchar -> CWchar -> CWchar #(^) :: (IsNatural n, Enum n, IDivisible n) => CWchar -> n -> CWchar # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CSigAtomic -> n -> CSigAtomic # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CClock -> CClock -> CClock #(^) :: (IsNatural n, Enum n, IDivisible n) => CClock -> n -> CClock # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(*) :: CTime -> CTime -> CTime #(^) :: (IsNatural n, Enum n, IDivisible n) => CTime -> n -> CTime # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CUSeconds -> n -> CUSeconds # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CSUSeconds -> n -> CSUSeconds # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CIntPtr -> n -> CIntPtr # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CUIntPtr -> n -> CUIntPtr # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CIntMax -> n -> CIntMax # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => CUIntMax -> n -> CUIntMax # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => Word128 -> n -> Word128 # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => Word256 -> n -> Word256 # SizeValid n => Multiplicative (Bits n) # Instance detailsDefined in Basement.Bits Methods(*) :: 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

Methods

div :: a -> a -> a #

mod :: a -> a -> a #

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

Instances
 # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int -> Int -> Int #mod :: Int -> Int -> Int #divMod :: Int -> Int -> (Int, Int) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int8 -> Int8 -> Int8 #mod :: Int8 -> Int8 -> Int8 #divMod :: Int8 -> Int8 -> (Int8, Int8) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int16 -> Int16 -> Int16 #mod :: Int16 -> Int16 -> Int16 #divMod :: Int16 -> Int16 -> (Int16, Int16) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int32 -> Int32 -> Int32 #mod :: Int32 -> Int32 -> Int32 #divMod :: Int32 -> Int32 -> (Int32, Int32) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int64 -> Int64 -> Int64 #mod :: Int64 -> Int64 -> Int64 #divMod :: Int64 -> Int64 -> (Int64, Int64) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Integer -> Integer -> (Integer, Integer) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Natural -> Natural -> (Natural, Natural) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Word -> Word -> Word #mod :: Word -> Word -> Word #divMod :: Word -> Word -> (Word, Word) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Word8 -> Word8 -> Word8 #mod :: Word8 -> Word8 -> Word8 #divMod :: Word8 -> Word8 -> (Word8, Word8) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Word16 -> Word16 -> Word16 #mod :: Word16 -> Word16 -> Word16 #divMod :: Word16 -> Word16 -> (Word16, Word16) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Word32 -> Word32 -> Word32 #mod :: Word32 -> Word32 -> Word32 #divMod :: Word32 -> Word32 -> (Word32, Word32) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Word64 -> Word64 -> Word64 #mod :: Word64 -> Word64 -> Word64 #divMod :: Word64 -> Word64 -> (Word64, Word64) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CChar -> CChar -> CChar #mod :: CChar -> CChar -> CChar #divMod :: CChar -> CChar -> (CChar, CChar) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CSChar -> CSChar -> CSChar #mod :: CSChar -> CSChar -> CSChar #divMod :: CSChar -> CSChar -> (CSChar, CSChar) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CUChar -> CUChar -> CUChar #mod :: CUChar -> CUChar -> CUChar #divMod :: CUChar -> CUChar -> (CUChar, CUChar) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CShort -> CShort -> CShort #mod :: CShort -> CShort -> CShort #divMod :: CShort -> CShort -> (CShort, CShort) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CUShort -> CUShort -> (CUShort, CUShort) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CInt -> CInt -> CInt #mod :: CInt -> CInt -> CInt #divMod :: CInt -> CInt -> (CInt, CInt) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CUInt -> CUInt -> CUInt #mod :: CUInt -> CUInt -> CUInt #divMod :: CUInt -> CUInt -> (CUInt, CUInt) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CLong -> CLong -> CLong #mod :: CLong -> CLong -> CLong #divMod :: CLong -> CLong -> (CLong, CLong) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CULong -> CULong -> CULong #mod :: CULong -> CULong -> CULong #divMod :: CULong -> CULong -> (CULong, CULong) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CLLong -> CLLong -> CLLong #mod :: CLLong -> CLLong -> CLLong #divMod :: CLLong -> CLLong -> (CLLong, CLLong) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CULLong -> CULLong -> (CULLong, CULLong) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CPtrdiff -> CPtrdiff -> (CPtrdiff, CPtrdiff) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CSize -> CSize -> CSize #mod :: CSize -> CSize -> CSize #divMod :: CSize -> CSize -> (CSize, CSize) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CWchar -> CWchar -> CWchar #mod :: CWchar -> CWchar -> CWchar #divMod :: CWchar -> CWchar -> (CWchar, CWchar) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CIntPtr -> CIntPtr -> (CIntPtr, CIntPtr) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CUIntPtr -> CUIntPtr -> (CUIntPtr, CUIntPtr) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CIntMax -> CIntMax -> (CIntMax, CIntMax) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CUIntMax -> CUIntMax -> (CUIntMax, CUIntMax) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Word128 -> Word128 -> (Word128, Word128) # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Word256 -> Word256 -> (Word256, Word256) # SizeValid n => IDivisible (Bits n) # Instance detailsDefined in Basement.Bits Methodsdiv :: 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
 # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(/) :: Double -> Double -> Double # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(/) :: Float -> Float -> Float # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(/) :: CFloat -> CFloat -> CFloat # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods

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