ideas-1.3.1: Feedback services for intelligent tutoring systems

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

Ideas.Common.Algebra.Boolean

Description

Synopsis

# Boolean algebra

class BoolValue a where Source

Minimal complete definition

Methods

true :: a Source

false :: a Source

fromBool :: Bool -> a Source

isTrue :: a -> Bool Source

isFalse :: a -> Bool Source

Instances

 BoolValue Bool BoolValue a => BoolValue (Smart a) BoolValue (Predicate a) BoolValue b => BoolValue (a -> b)

class BoolValue a => Boolean a where Source

Methods

(<&&>) :: a -> a -> a Source

(<||>) :: a -> a -> a Source

complement :: a -> a Source

Instances

 Boolean Bool (Boolean a, CoBoolean a) => Boolean (Smart a) Boolean (Predicate a) Boolean b => Boolean (a -> b)

ands :: Boolean a => [a] -> a Source

ors :: Boolean a => [a] -> a Source

implies :: Boolean a => a -> a -> a Source

equivalent :: Boolean a => a -> a -> a Source

# CoBoolean (matching)

class BoolValue a => CoBoolean a where Source

Methods

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

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

isComplement :: a -> Maybe a Source

conjunctions :: CoBoolean a => a -> [a] Source

disjunctions :: CoBoolean a => a -> [a] Source

# Monoids monoid

class MonoidZero a => DualMonoid a where Source

Methods

(><) :: a -> a -> a Source

dualCompl :: a -> a Source

Instances

 Boolean a => DualMonoid (Or a) Boolean a => DualMonoid (And a)

newtype And a Source

Constructors

 And FieldsfromAnd :: a

Instances

 Functor And Applicative And Eq a => Eq (And a) Ord a => Ord (And a) Show a => Show (And a) Arbitrary a => Arbitrary (And a) CoArbitrary a => CoArbitrary (And a) Boolean a => Monoid (And a) CoBoolean a => CoMonoidZero (And a) CoBoolean a => CoMonoid (And a) Boolean a => MonoidZero (And a) Boolean a => DualMonoid (And a)

newtype Or a Source

Constructors

 Or FieldsfromOr :: a

Instances

 Functor Or Applicative Or Eq a => Eq (Or a) Ord a => Ord (Or a) Show a => Show (Or a) Arbitrary a => Arbitrary (Or a) CoArbitrary a => CoArbitrary (Or a) Boolean a => Monoid (Or a) CoBoolean a => CoMonoidZero (Or a) CoBoolean a => CoMonoid (Or a) Boolean a => MonoidZero (Or a) Boolean a => DualMonoid (Or a)