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

Recognize.Model.Constraint

Description

This module defines the constraint data types. We differentiate between two constraint types:

• Node constraint
• regular constraint

The regular constraint consists of a set of identifiers and a function that consumes some type a and produces a Result. The set of identifiers come from combining constraints using the connectives defined in Connectives.

A Node constraint is simply a product of a Node Bool (the node) and a regular constraint. The constraint then corresponds to a node in one of the networks.

Synopsis

# Documentation

data NodeConstraint b m a Source #

Wraps over a constraint by giving it a specific node

Constructors

 NodeConstraint FieldsgetNode :: Node bThe node of a constraintgetConstraint :: Constraint m aThe underlying constraint

data Constraint m a Source #

Models constraints that have an identifier and describe predicates that produce a result

Constructors

 Constraint FieldsgetResult :: a -> m ResultPredicates that produces a Result given an a
Instances
 Source # Instance detailsDefined in Recognize.Model.Constraint Methodsstimes :: Integral b => b -> Constraint EvBuilder a -> Constraint EvBuilder a # Source # Instance detailsDefined in Recognize.Model.Constraint Methods

giveNode :: Node b -> Constraint m a -> NodeConstraint b m a Source #

Couple a constraint to a specific Node

makeNodeConstraint :: Node b -> (a -> m Result) -> NodeConstraint b m a Source #

Makes a nodeconstraint:

combinePredicates :: (a -> EvBuilder Result) -> (a -> EvBuilder Result) -> a -> EvBuilder Result Source #

Combines two predicates into one