Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
- class SemiRing a where
- class SemiRing a => Ring a where
- plusInverse :: a -> a
- (<->) :: a -> a -> a
- class Ring a => Field a where
- timesInverse :: a -> a
- (</>) :: a -> a -> a
- newtype Additive a = Additive {
- fromAdditive :: a
- newtype Multiplicative a = Multiplicative {
- fromMultiplicative :: a
- data SafeNum a
- safeNum :: SafeNum a -> Either String a
- class CoSemiRing a where
- class CoSemiRing a => CoRing a where
- class CoRing a => CoField a where
- isRecip :: a -> Maybe a
- isDivision :: a -> Maybe (a, a)
Semi-ring
Ring
Field
class Ring a => Field a where Source
Nothing
timesInverse :: a -> a Source
(Eq a, Fractional a) => Field (SafeNum a) | |
(CoField a, Field a) => Field (SmartField a) |
Additive monoid
Additive | |
|
Functor Additive | |
Applicative Additive | |
Eq a => Eq (Additive a) | |
Ord a => Ord (Additive a) | |
Show a => Show (Additive a) | |
Arbitrary a => Arbitrary (Additive a) | |
CoArbitrary a => CoArbitrary (Additive a) | |
SemiRing a => Monoid (Additive a) | |
CoRing a => CoGroup (Additive a) | |
CoSemiRing a => CoMonoid (Additive a) | |
Ring a => Group (Additive a) |
Multiplicative monoid
newtype Multiplicative a Source
Functor Multiplicative | |
Applicative Multiplicative | |
Eq a => Eq (Multiplicative a) | |
Ord a => Ord (Multiplicative a) | |
Show a => Show (Multiplicative a) | |
Arbitrary a => Arbitrary (Multiplicative a) | |
CoArbitrary a => CoArbitrary (Multiplicative a) | |
SemiRing a => Monoid (Multiplicative a) | |
CoSemiRing a => CoMonoidZero (Multiplicative a) | |
CoField a => CoGroup (Multiplicative a) | |
CoSemiRing a => CoMonoid (Multiplicative a) | |
SemiRing a => MonoidZero (Multiplicative a) | |
Field a => Group (Multiplicative a) |
Datatype for safe numeric operators
Monad SafeNum | |
Functor SafeNum | |
Eq a => Eq (SafeNum a) | |
(Eq a, Fractional a) => Fractional (SafeNum a) | |
Num a => Num (SafeNum a) | |
Ord a => Ord (SafeNum a) | |
Show a => Show (SafeNum a) | |
Arbitrary a => Arbitrary (SafeNum a) | |
(Eq a, Fractional a) => Field (SafeNum a) | |
Num a => Ring (SafeNum a) | |
Num a => SemiRing (SafeNum a) |
CoSemiRing, CoRing, and CoField (for matching)
class CoSemiRing a where Source
CoSemiRing a => CoSemiRing (SmartField a) |
class CoSemiRing a => CoRing a where Source
CoRing a => CoRing (SmartField a) |