ContentsIndex
Org.Org.Semantic.HBase.Basic.Arithmetic
Description
These classes are nominal.
Synopsis
class HasZero a where
isZero :: a -> Bool
zero :: a
isPositiveStrict :: (HasZero a, MaybeOrdered a) => a -> Bool
isNegativeStrict :: (HasZero a, MaybeOrdered a) => a -> Bool
isPositiveInclusive :: (HasZero a, MaybeOrdered a) => a -> Bool
isNegativeInclusive :: (HasZero a, MaybeOrdered a) => a -> Bool
class Additive a b ab | a b -> ab where
add :: a -> b -> ab
(+) :: Additive a a a => a -> a -> a
sum :: (HasZero a, Additive a a a) => [a] -> a
class Negatable a where
negate :: a -> a
class Subtractive a b ab | a b -> ab where
subtract :: a -> b -> ab
(-) :: Subtractive a a a => a -> a -> a
class HasOne a where
isOne :: a -> Bool
one :: a
class Multiplicative a b ab | a b -> ab where
multiply :: a -> b -> ab
(*) :: Multiplicative a a a => a -> a -> a
product :: (HasOne a, Multiplicative a a a) => [a] -> a
class HasAbsolute k a | a -> k where
absolute :: a -> k
class HasSignum a where
signum :: a -> a
Documentation
class HasZero a where
Has a value that's 'zero' in some sense.
Methods
isZero :: a -> Bool
zero :: a
Typically zero should be identity for add.
Instances
HasZero Int
HasZero Integer
HasZero Word8
HasZero Int8
HasZero Word16
HasZero Int16
HasZero Word32
HasZero Int32
HasZero Word64
HasZero Int64
HasZero r => HasZero (Complex r)
HasZero Double
(HasZero a, HasReturn p, HasReturn q, ExtractableFunctor p, ExtractableFunctor q) => HasZero (FunctorMatrix p q a)
(HasZero a, HasReturn t, ExtractableFunctor t) => HasZero (FunctorVector t a)
HasZero EIReal
HasZero a => HasZero (InfExtended a)
HasZero Rational
HasZero a => HasZero (VectorWrapper t a)
HasZero a => HasZero (UTCDuration a)
isPositiveStrict :: (HasZero a, MaybeOrdered a) => a -> Bool
isNegativeStrict :: (HasZero a, MaybeOrdered a) => a -> Bool
isPositiveInclusive :: (HasZero a, MaybeOrdered a) => a -> Bool
isNegativeInclusive :: (HasZero a, MaybeOrdered a) => a -> Bool
class Additive a b ab | a b -> ab where
Methods
add :: a -> b -> ab
Add a to b.
Instances
Additive Int Int Int
Additive Integer Integer Integer
Additive Word8 Word8 Word8
Additive Int8 Int8 Int8
Additive Word16 Word16 Word16
Additive Int16 Int16 Int16
Additive Word32 Word32 Word32
Additive Int32 Int32 Int32
Additive Word64 Word64 Word64
Additive Int64 Int64 Int64
Additive a a aa => Additive (Complex a) (Complex a) (Complex aa)
Additive a a a => Additive a (Complex a) (Complex a)
Additive a a a => Additive (Complex a) a (Complex a)
Additive Double Double Double
(Additive a b c, FunctorApply p, FunctorApply q) => Additive (FunctorMatrix p q a) (FunctorMatrix p q b) (FunctorMatrix p q c)
(Additive a b c, FunctorApply t) => Additive (FunctorVector t a) (FunctorVector t b) (FunctorVector t c)
Additive EIReal EIReal EIReal
Additive a b c => Additive (InfExtended a) (InfExtended b) (NaNExtended (InfExtended c))
() => Additive (NaNExtended Integer) (NaNExtended Integer) (NaNExtended Integer)
() => Additive Integer (NaNExtended Integer) (NaNExtended Integer)
() => Additive (NaNExtended Integer) Integer (NaNExtended Integer)
() => Additive (NaNExtended Int) (NaNExtended Int) (NaNExtended Int)
() => Additive Int (NaNExtended Int) (NaNExtended Int)
() => Additive (NaNExtended Int) Int (NaNExtended Int)
() => Additive (NaNExtended Word8) (NaNExtended Word8) (NaNExtended Word8)
() => Additive Word8 (NaNExtended Word8) (NaNExtended Word8)
() => Additive (NaNExtended Word8) Word8 (NaNExtended Word8)
() => Additive (NaNExtended Int8) (NaNExtended Int8) (NaNExtended Int8)
() => Additive Int8 (NaNExtended Int8) (NaNExtended Int8)
() => Additive (NaNExtended Int8) Int8 (NaNExtended Int8)
() => Additive (NaNExtended Word16) (NaNExtended Word16) (NaNExtended Word16)
() => Additive Word16 (NaNExtended Word16) (NaNExtended Word16)
() => Additive (NaNExtended Word16) Word16 (NaNExtended Word16)
() => Additive (NaNExtended Int16) (NaNExtended Int16) (NaNExtended Int16)
() => Additive Int16 (NaNExtended Int16) (NaNExtended Int16)
() => Additive (NaNExtended Int16) Int16 (NaNExtended Int16)
() => Additive (NaNExtended Word32) (NaNExtended Word32) (NaNExtended Word32)
() => Additive Word32 (NaNExtended Word32) (NaNExtended Word32)
() => Additive (NaNExtended Word32) Word32 (NaNExtended Word32)
() => Additive (NaNExtended Int32) (NaNExtended Int32) (NaNExtended Int32)
() => Additive Int32 (NaNExtended Int32) (NaNExtended Int32)
() => Additive (NaNExtended Int32) Int32 (NaNExtended Int32)
() => Additive (NaNExtended Word64) (NaNExtended Word64) (NaNExtended Word64)
() => Additive Word64 (NaNExtended Word64) (NaNExtended Word64)
() => Additive (NaNExtended Word64) Word64 (NaNExtended Word64)
() => Additive (NaNExtended Int64) (NaNExtended Int64) (NaNExtended Int64)
() => Additive Int64 (NaNExtended Int64) (NaNExtended Int64)
() => Additive (NaNExtended Int64) Int64 (NaNExtended Int64)
() => Additive (NaNExtended Rational) (NaNExtended Rational) (NaNExtended Rational)
() => Additive Rational (NaNExtended Rational) (NaNExtended Rational)
() => Additive (NaNExtended Rational) Rational (NaNExtended Rational)
Additive Rational Rational Rational
Additive Integer Rational Rational
Additive Rational Integer Rational
Additive a b c => Additive (VectorWrapper t a) (VectorWrapper t b) (VectorWrapper t c)
Additive a b c => Additive (VectorWrapper t a) (PointWrapper t b) (PointWrapper t c)
Additive Integer Char Char
(Additive a a a, HasIntegerDivide Integer a, InterpretIntegerLiteral a) => Additive (UTCDuration a) (UTCDuration a) (UTCDuration a)
(Additive a a a, HasIntegerDivide Integer a, InterpretIntegerLiteral a) => Additive (UTCDuration a) (UTCTime a) (UTCTime a)
(+) :: Additive a a a => a -> a -> a
This is add with the arguments swapped, as per subtract.
sum :: (HasZero a, Additive a a a) => [a] -> a
class Negatable a where
Methods
negate :: a -> a
Instances
Negatable Int
Negatable Integer
Negatable Int8
Negatable Int16
Negatable Int32
Negatable Int64
Negatable a => Negatable (Complex a)
Negatable Double
(Negatable a, Functor p, Functor q) => Negatable (FunctorMatrix p q a)
(Negatable a, Functor t) => Negatable (FunctorVector t a)
Negatable EIReal
Negatable a => Negatable (InfExtended a)
Negatable Rational
Negatable a => Negatable (VectorWrapper t a)
class Subtractive a b ab | a b -> ab where
Methods
subtract :: a -> b -> ab
Watch out, "subtract a b" means "subtract a from b" i.e. "b - a".
Instances
Subtractive Int Int Int
Subtractive Integer Integer Integer
Subtractive Word8 Word8 Word8
Subtractive Int8 Int8 Int8
Subtractive Word16 Word16 Word16
Subtractive Int16 Int16 Int16
Subtractive Word32 Word32 Word32
Subtractive Int32 Int32 Int32
Subtractive Word64 Word64 Word64
Subtractive Int64 Int64 Int64
Subtractive a a aa => Subtractive (Complex a) (Complex a) (Complex aa)
Subtractive a a a => Subtractive a (Complex a) (Complex a)
(Subtractive a a a, Negatable a) => Subtractive (Complex a) a (Complex a)
Subtractive Double Double Double
(Subtractive a b c, FunctorApply p, FunctorApply q) => Subtractive (FunctorMatrix p q a) (FunctorMatrix p q b) (FunctorMatrix p q c)
(Subtractive a b c, FunctorApply t) => Subtractive (FunctorVector t a) (FunctorVector t b) (FunctorVector t c)
Subtractive EIReal EIReal EIReal
Subtractive a b c => Subtractive (InfExtended a) (InfExtended b) (NaNExtended (InfExtended c))
() => Subtractive (NaNExtended Integer) (NaNExtended Integer) (NaNExtended Integer)
() => Subtractive Integer (NaNExtended Integer) (NaNExtended Integer)
() => Subtractive (NaNExtended Integer) Integer (NaNExtended Integer)
() => Subtractive (NaNExtended Int) (NaNExtended Int) (NaNExtended Int)
() => Subtractive Int (NaNExtended Int) (NaNExtended Int)
() => Subtractive (NaNExtended Int) Int (NaNExtended Int)
() => Subtractive (NaNExtended Word8) (NaNExtended Word8) (NaNExtended Word8)
() => Subtractive Word8 (NaNExtended Word8) (NaNExtended Word8)
() => Subtractive (NaNExtended Word8) Word8 (NaNExtended Word8)
() => Subtractive (NaNExtended Int8) (NaNExtended Int8) (NaNExtended Int8)
() => Subtractive Int8 (NaNExtended Int8) (NaNExtended Int8)
() => Subtractive (NaNExtended Int8) Int8 (NaNExtended Int8)
() => Subtractive (NaNExtended Word16) (NaNExtended Word16) (NaNExtended Word16)
() => Subtractive Word16 (NaNExtended Word16) (NaNExtended Word16)
() => Subtractive (NaNExtended Word16) Word16 (NaNExtended Word16)
() => Subtractive (NaNExtended Int16) (NaNExtended Int16) (NaNExtended Int16)
() => Subtractive Int16 (NaNExtended Int16) (NaNExtended Int16)
() => Subtractive (NaNExtended Int16) Int16 (NaNExtended Int16)
() => Subtractive (NaNExtended Word32) (NaNExtended Word32) (NaNExtended Word32)
() => Subtractive Word32 (NaNExtended Word32) (NaNExtended Word32)
() => Subtractive (NaNExtended Word32) Word32 (NaNExtended Word32)
() => Subtractive (NaNExtended Int32) (NaNExtended Int32) (NaNExtended Int32)
() => Subtractive Int32 (NaNExtended Int32) (NaNExtended Int32)
() => Subtractive (NaNExtended Int32) Int32 (NaNExtended Int32)
() => Subtractive (NaNExtended Word64) (NaNExtended Word64) (NaNExtended Word64)
() => Subtractive Word64 (NaNExtended Word64) (NaNExtended Word64)
() => Subtractive (NaNExtended Word64) Word64 (NaNExtended Word64)
() => Subtractive (NaNExtended Int64) (NaNExtended Int64) (NaNExtended Int64)
() => Subtractive Int64 (NaNExtended Int64) (NaNExtended Int64)
() => Subtractive (NaNExtended Int64) Int64 (NaNExtended Int64)
() => Subtractive (NaNExtended Rational) (NaNExtended Rational) (NaNExtended Rational)
() => Subtractive Rational (NaNExtended Rational) (NaNExtended Rational)
() => Subtractive (NaNExtended Rational) Rational (NaNExtended Rational)
Subtractive Rational Rational Rational
Subtractive Integer Rational Rational
Subtractive Rational Integer Rational
Subtractive a b c => Subtractive (VectorWrapper t a) (VectorWrapper t b) (VectorWrapper t c)
Subtractive a b c => Subtractive (VectorWrapper t a) (PointWrapper t b) (PointWrapper t c)
Subtractive a b c => Subtractive (PointWrapper t a) (PointWrapper t b) (VectorWrapper t c)
Subtractive Integer Char Char
Subtractive Char Char Integer
(Subtractive a a a, HasIntegerDivide Integer a, InterpretIntegerLiteral a) => Subtractive (UTCDuration a) (UTCDuration a) (UTCDuration a)
(Subtractive a a a, HasIntegerDivide Integer a, InterpretIntegerLiteral a) => Subtractive (UTCDuration a) (UTCTime a) (UTCTime a)
(Subtractive a a a, HasIntegerDivide Integer a, InterpretIntegerLiteral a) => Subtractive (UTCTime a) (UTCTime a) (UTCDuration a)
(-) :: Subtractive a a a => a -> a -> a
This is subtract with the arguments swapped.
class HasOne a where
Has a value that's 'one' in some sense.
Methods
isOne :: a -> Bool
one :: a
Typically one should be identity for multiply.
Instances
HasOne Int
HasOne Integer
HasOne Word8
HasOne Int8
HasOne Word16
HasOne Int16
HasOne Word32
HasOne Int32
HasOne Word64
HasOne Int64
(HasZero r, HasOne r) => HasOne (Complex r)
HasOne Double
(HasZero a, HasOne a, ExtractableFunctor p, FunctorApply p, SameIndexSquare p) => HasOne (FunctorMatrix p p a)
HasOne EIReal
HasOne a => HasOne (InfExtended a)
HasOne Rational
HasOne a => HasOne (VectorWrapper t a)
class Multiplicative a b ab | a b -> ab where
Methods
multiply :: a -> b -> ab
multiply b by a.
Instances
Multiplicative Int Int Int
Multiplicative Integer Integer Integer
Multiplicative Word8 Word8 Word8
Multiplicative Int8 Int8 Int8
Multiplicative Word16 Word16 Word16
Multiplicative Int16 Int16 Int16
Multiplicative Word32 Word32 Word32
Multiplicative Int32 Int32 Int32
Multiplicative Word64 Word64 Word64
Multiplicative Int64 Int64 Int64
(Multiplicative a a aa, Additive aa aa c, Subtractive aa aa c) => Multiplicative (Complex a) (Complex a) (Complex c)
Multiplicative a a c => Multiplicative a (Complex a) (Complex c)
Multiplicative Double Double Double
Multiplicative Integer Double Double
(Multiplicative a a c, Functor p, Functor q) => Multiplicative a (FunctorMatrix p q a) (FunctorMatrix p q c)
(Multiplicative a a c, HasZero c, Additive c c c, Functor p, FunctorApply q, ExtractableFunctor q, FunctorApplyReturn r) => Multiplicative (FunctorMatrix p q a) (FunctorMatrix q r a) (FunctorMatrix p r c)
(Multiplicative a a c, HasZero c, Additive c c c, Functor p, FunctorApply q, ExtractableFunctor q) => Multiplicative (FunctorMatrix p q a) (FunctorVector q a) (FunctorVector p c)
(Multiplicative a a c, Functor t) => Multiplicative a (FunctorVector t a) (FunctorVector t c)
Multiplicative EIReal EIReal EIReal
(HasZero a, HasZero b, Multiplicative a b c) => Multiplicative (InfExtended a) (InfExtended b) (NaNExtended (InfExtended c))
() => Multiplicative (NaNExtended Integer) (NaNExtended Integer) (NaNExtended Integer)
() => Multiplicative Integer (NaNExtended Integer) (NaNExtended Integer)
() => Multiplicative (NaNExtended Integer) Integer (NaNExtended Integer)
() => Multiplicative (NaNExtended Int) (NaNExtended Int) (NaNExtended Int)
() => Multiplicative Int (NaNExtended Int) (NaNExtended Int)
() => Multiplicative (NaNExtended Int) Int (NaNExtended Int)
() => Multiplicative (NaNExtended Word8) (NaNExtended Word8) (NaNExtended Word8)
() => Multiplicative Word8 (NaNExtended Word8) (NaNExtended Word8)
() => Multiplicative (NaNExtended Word8) Word8 (NaNExtended Word8)
() => Multiplicative (NaNExtended Int8) (NaNExtended Int8) (NaNExtended Int8)
() => Multiplicative Int8 (NaNExtended Int8) (NaNExtended Int8)
() => Multiplicative (NaNExtended Int8) Int8 (NaNExtended Int8)
() => Multiplicative (NaNExtended Word16) (NaNExtended Word16) (NaNExtended Word16)
() => Multiplicative Word16 (NaNExtended Word16) (NaNExtended Word16)
() => Multiplicative (NaNExtended Word16) Word16 (NaNExtended Word16)
() => Multiplicative (NaNExtended Int16) (NaNExtended Int16) (NaNExtended Int16)
() => Multiplicative Int16 (NaNExtended Int16) (NaNExtended Int16)
() => Multiplicative (NaNExtended Int16) Int16 (NaNExtended Int16)
() => Multiplicative (NaNExtended Word32) (NaNExtended Word32) (NaNExtended Word32)
() => Multiplicative Word32 (NaNExtended Word32) (NaNExtended Word32)
() => Multiplicative (NaNExtended Word32) Word32 (NaNExtended Word32)
() => Multiplicative (NaNExtended Int32) (NaNExtended Int32) (NaNExtended Int32)
() => Multiplicative Int32 (NaNExtended Int32) (NaNExtended Int32)
() => Multiplicative (NaNExtended Int32) Int32 (NaNExtended Int32)
() => Multiplicative (NaNExtended Word64) (NaNExtended Word64) (NaNExtended Word64)
() => Multiplicative Word64 (NaNExtended Word64) (NaNExtended Word64)
() => Multiplicative (NaNExtended Word64) Word64 (NaNExtended Word64)
() => Multiplicative (NaNExtended Int64) (NaNExtended Int64) (NaNExtended Int64)
() => Multiplicative Int64 (NaNExtended Int64) (NaNExtended Int64)
() => Multiplicative (NaNExtended Int64) Int64 (NaNExtended Int64)
() => Multiplicative (NaNExtended Rational) (NaNExtended Rational) (NaNExtended Rational)
() => Multiplicative Rational (NaNExtended Rational) (NaNExtended Rational)
() => Multiplicative (NaNExtended Rational) Rational (NaNExtended Rational)
Multiplicative Rational Rational Rational
Multiplicative Integer Rational Rational
Multiplicative Rational Integer Rational
Multiplicative n a b => Multiplicative n (VectorWrapper t a) (VectorWrapper t b)
(*) :: Multiplicative a a a => a -> a -> a
This is multiply with the arguments swapped, as per divide.
product :: (HasOne a, Multiplicative a a a) => [a] -> a
class HasAbsolute k a | a -> k where
Methods
absolute :: a -> k
Instances
HasAbsolute Int Int
HasAbsolute Integer Integer
HasAbsolute Word8 Word8
HasAbsolute Int8 Int8
HasAbsolute Word16 Word16
HasAbsolute Int16 Int16
HasAbsolute Word32 Word32
HasAbsolute Int32 Int32
HasAbsolute Word64 Word64
HasAbsolute Int64 Int64
(ApproxMath a, HasAbsolute a a) => HasAbsolute a (Complex a)
HasAbsolute Double Double
HasAbsolute EIReal EIReal
HasAbsolute k a => HasAbsolute (InfExtended k) (InfExtended a)
HasAbsolute Rational Rational
class HasSignum a where
Methods
signum :: a -> a
Instances
HasSignum Int
HasSignum Integer
HasSignum Word8
HasSignum Int8
HasSignum Word16
HasSignum Int16
HasSignum Word32
HasSignum Int32
HasSignum Word64
HasSignum Int64
(ApproxMath a, HasAbsolute a a) => HasSignum (Complex a)
HasSignum Double
HasSignum EIReal
HasSignum a => HasSignum (InfExtended a)
HasSignum Rational
Produced by Haddock version 0.6