ideas-1.5: Feedback services for intelligent tutoring systems

Maintainerbastiaan.heeren@ou.nl
Stabilityprovisional
Portabilityportable (depends on ghc)
Safe HaskellNone
LanguageHaskell98

Ideas.Common.Algebra.Field

Contents

Description

 

Synopsis

Semi-ring

class SemiRing a where Source

Minimal complete definition

(|+|), zero, (|*|), one

Methods

(|+|) :: a -> a -> a infixl 6 Source

zero :: a Source

sum :: [a] -> a Source

(|*|) :: a -> a -> a infixl 7 Source

one :: a Source

product :: [a] -> a Source

Instances

Ring

class SemiRing a => Ring a where Source

Minimal complete definition

Nothing

Methods

plusInverse :: a -> a Source

(|-|) :: a -> a -> a infixl 6 Source

Instances

Field

class Ring a => Field a where Source

Minimal complete definition

Nothing

Methods

timesInverse :: a -> a Source

(|/|) :: a -> a -> a infixl 7 Source

Instances

Additive monoid

Multiplicative monoid

Datatype for safe numeric operators

CoSemiRing, CoRing, and CoField (for matching)

class CoSemiRing a where Source

Methods

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

isZero :: a -> Bool Source

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

isOne :: a -> Bool Source

class CoSemiRing a => CoRing a where Source

Minimal complete definition

isNegate

Methods

isNegate :: a -> Maybe a Source

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

Instances

class CoRing a => CoField a where Source

Minimal complete definition

isRecip

Methods

isRecip :: a -> Maybe a Source

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

Instances