ideas-1.3.1: Feedback services for intelligent tutoring systems

Maintainerbastiaan.heeren@ou.nl
Stabilityprovisional
Portabilityportable (depends on ghc)
Safe HaskellSafe-Inferred
LanguageHaskell98

Ideas.Common.Strategy.Sequence

Contents

Description

A type class for sequences together with the Step datatype.

Synopsis

Sequence type class

class Sequence f where Source

Methods

done :: f a Source

The empty sequence.

(~>) :: a -> f a -> f a infixr 5 Source

Prefix a sequence with one element.

(<*>) :: f a -> f a -> f a infixr 5 Source

Append two sequences.

Firsts type class

class Firsts s where Source

Minimal complete definition

menu

Associated Types

type Elem s Source

The type associated with a step in the first set.

Methods

ready :: s -> Bool Source

The ready predicate (we are done).

firsts :: s -> [(Elem s, s)] Source

The first set.

menu :: s -> Menu (MenuItem (Elem s) s) Source

The menu offers single steps (with the remainder) and done steps.

Instances

firstsMenu :: Firsts s => s -> Menu (Elem s, s) Source

firstsOrdered :: Firsts s => (Elem s -> Elem s -> Ordering) -> s -> [(Elem s, s)] Source

stopped :: Firsts s => s -> Bool Source

Not ready and no further steps to take.

MenuItem data type with some utility functions

data MenuItem a s Source

Constructors

a :~> s infixr 5

A single step.

Done

No step (we are done).

menuItem :: b -> (a -> s -> b) -> MenuItem a s -> b Source

The menuItem function takes a default value for Done and a function to combine the values for a single step.

isDone :: MenuItem a s -> Bool Source

Is the item done?