Safe Haskell | None |
---|---|
Language | Haskell2010 |
Field classes
- class (MultiplicativeInvertible a, MultiplicativeGroup a, Semiring a) => Semifield a
- class (AdditiveGroup a, MultiplicativeGroup a, Ring a) => Field a
- class Field a => ExpField a where
- class (Ord a, Field a, Eq b, Integral b, AdditiveGroup b, MultiplicativeUnital b) => QuotientField a b where
- class Semifield a => UpperBoundedField a where
- class Field a => LowerBoundedField a where
- class (UpperBoundedField a, LowerBoundedField a) => BoundedField a
- class Field a => TrigField a where
Documentation
class (MultiplicativeInvertible a, MultiplicativeGroup a, Semiring a) => Semifield a Source #
A Semifield is chosen here to be a Field without an Additive Inverse
class (AdditiveGroup a, MultiplicativeGroup a, Ring a) => Field a Source #
A Field is a Ring plus additive invertible and multiplicative invertible operations.
A summary of the rules inherited from super-classes of Field
zero + a == a a + zero == a (a + b) + c == a + (b + c) a + b == b + a a - a = zero negate a = zero - a negate a + a = zero a + negate a = zero one * a == a a * one == a (a * b) * c == a * (b * c) a * (b + c) == a * b + a * c (a + b) * c == a * c + b * c a * zero == zero zero * a == zero a * b == b * a a / a = one recip a = one / a recip a * a = one a * recip a = one
class Field a => ExpField a where Source #
A hyperbolic field class
sqrt . (**2) == identity log . exp == identity for +ive b, a != 0,1: a ** logBase a b ≈ b
class (Ord a, Field a, Eq b, Integral b, AdditiveGroup b, MultiplicativeUnital b) => QuotientField a b where Source #
quotient fields explode constraints if they allow for polymorphic integral types
a - one < floor a <= a <= ceiling a < a + one round a == floor (a + one/(one+one))
fixme: had to redefine Signed operators here because of the Field import in Metric, itself due to Complex being defined there
properFraction :: a -> (b, a) Source #
QuotientField Double Integer Source # | |
QuotientField Float Integer Source # | |
(Ord a, Signed a, ToInteger a, Integral a, Multiplicative a, Ring a, Eq b, AdditiveGroup b, Integral b, FromInteger b) => QuotientField (Ratio a) b Source # | |
class Semifield a => UpperBoundedField a where Source #
A bounded field includes the concepts of infinity and NaN, thus moving away from error throwing.
one / zero + infinity == infinity infinity + a == infinity zero / zero != nan
Note the tricky law that, although nan is assigned to zero/zero, they are never-the-less not equal. A committee decided this.
UpperBoundedField Double Source # | |
UpperBoundedField Float Source # | |
(AdditiveGroup a, UpperBoundedField a) => UpperBoundedField (Complex a) Source # | todo: work out boundings for complex as it stands now, complex is different eg one / (zero :: Complex Float) == nan |
(Ord a, Signed a, Integral a, AdditiveInvertible a, Multiplicative a, Ring a) => UpperBoundedField (Ratio a) Source # | |
class Field a => LowerBoundedField a where Source #
negInfinity :: a Source #
LowerBoundedField Double Source # | |
LowerBoundedField Float Source # | |
(Ord a, Signed a, Integral a, Multiplicative a, Ring a, AdditiveInvertible a) => LowerBoundedField (Ratio a) Source # | |
class (UpperBoundedField a, LowerBoundedField a) => BoundedField a Source #
(UpperBoundedField a, LowerBoundedField a) => BoundedField a Source # | |