ideas-1.1: Feedback services for intelligent tutoring systems

Portability portable (depends on ghc) provisional bastiaan.heeren@ou.nl None

Ideas.Common.Algebra.Field

Description

Synopsis

Semi-ring

class SemiRing a whereSource

Methods

(<+>) :: a -> a -> aSource

zero :: aSource

sum :: [a] -> aSource

(<*>) :: a -> a -> aSource

one :: aSource

product :: [a] -> aSource

Instances

 Num a => SemiRing (SafeNum a) (CoField a, Field a) => SemiRing (SmartField a)

Ring

class SemiRing a => Ring a whereSource

Methods

plusInverse :: a -> aSource

(<->) :: a -> a -> aSource

Instances

 Num a => Ring (SafeNum a) (CoField a, Field a) => Ring (SmartField a)

Field

class Ring a => Field a whereSource

Methods

timesInverse :: a -> aSource

(</>) :: a -> a -> aSource

Instances

 (Eq a, Fractional a) => Field (SafeNum a) (CoField a, Field a) => Field (SmartField a)

Constructors

Instances

Multiplicative monoid

newtype Multiplicative a Source

Constructors

 Multiplicative FieldsfromMultiplicative :: a

Instances

 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

data SafeNum a Source

Instances

 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 whereSource

Methods

isPlus :: a -> Maybe (a, a)Source

isZero :: a -> BoolSource

isTimes :: a -> Maybe (a, a)Source

isOne :: a -> BoolSource

Instances

 CoSemiRing a => CoSemiRing (SmartField a)

class CoSemiRing a => CoRing a whereSource

Methods

isNegate :: a -> Maybe aSource

isMinus :: a -> Maybe (a, a)Source

Instances

 CoRing a => CoRing (SmartField a)

class CoRing a => CoField a whereSource

Methods

isRecip :: a -> Maybe aSource

isDivision :: a -> Maybe (a, a)Source

Instances

 CoField a => CoField (SmartField a)