Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Multiplicative a where
- class (Additive a, Multiplicative a) => IDivisible a where
- class Multiplicative a => Divisible a where
- (/) :: a -> a -> a
- recip :: Divisible a => a -> a
Documentation
class Multiplicative a where #
Represent class of things that can be multiplied together
x * midentity = x midentity * x = x
Identity element over multiplication
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
class (Additive a, Multiplicative a) => IDivisible a where #
Represent types that supports an euclidian division
(x ‘div‘ y) * y + (x ‘mod‘ y) == x