basement-0.0.9: Foundation scrap box of array & string

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

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

Methods

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

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

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

Instances
 Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int -> Int -> Int Source #mod :: Int -> Int -> Int Source #divMod :: Int -> Int -> (Int, Int) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Int8 -> Int8 -> Int8 Source #mod :: Int8 -> Int8 -> Int8 Source #divMod :: Int8 -> Int8 -> (Int8, Int8) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Int16 -> Int16 -> (Int16, Int16) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Int32 -> Int32 -> (Int32, Int32) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Int64 -> Int64 -> (Int64, Int64) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: Word -> Word -> Word Source #mod :: Word -> Word -> Word Source #divMod :: Word -> Word -> (Word, Word) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Word8 -> Word8 -> (Word8, Word8) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Word16 -> Word16 -> (Word16, Word16) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Word32 -> Word32 -> (Word32, Word32) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Word64 -> Word64 -> (Word64, Word64) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CChar -> CChar -> (CChar, CChar) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CSChar -> CSChar -> (CSChar, CSChar) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CUChar -> CUChar -> (CUChar, CUChar) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CShort -> CShort -> (CShort, CShort) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methodsdiv :: CInt -> CInt -> CInt Source #mod :: CInt -> CInt -> CInt Source #divMod :: CInt -> CInt -> (CInt, CInt) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CUInt -> CUInt -> (CUInt, CUInt) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CLong -> CLong -> (CLong, CLong) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CULong -> CULong -> (CULong, CULong) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CLLong -> CLLong -> (CLLong, CLLong) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CSize -> CSize -> (CSize, CSize) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: CWchar -> CWchar -> (CWchar, CWchar) Source # Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods SizeValid n => IDivisible (Bits n) Source # Instance detailsDefined in Basement.Bits Methodsdiv :: 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
 Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods Source # Instance detailsDefined in Basement.Numerical.Multiplicative Methods

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