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 Source #
Represent class of things that can be multiplied together
x * midentity = x midentity * x = x
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
class ( Additive a, Multiplicative a) => IDivisible a where Source #
Represent types that supports an euclidian division
(x ‘div‘ y) * y + (x ‘mod‘ y) == x
Instances
class Multiplicative a => Divisible a where Source #
Support for division between same types
This is likely to change to represent specific mathematic divisions