Advise-me-0.1: Assessment services for the Advise-Me project

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

Recognize.SubExpr.SEParser

Contents

Description

 
Synopsis

SubExpression Parser

get :: MonadState s m => m s #

Return the state from the internals of the monad.

put :: MonadState s m => s -> m () #

Replace the state inside the monad.

gets :: MonadState s m => (s -> a) -> m a #

Gets specific component of the state, using a projection function supplied.

modify :: MonadState s m => (s -> s) -> m () #

Monadic state transformer.

Maps an old state to a new state inside a state monad. The old state is thrown away.

     Main> :t modify ((+1) :: Int -> Int)
     modify (...) :: (MonadState Int a) => a ()

This says that modify (+1) acts over any Monad that is a member of the MonadState class, with an Int state.

User state

data SEState Source #

The user state of the subexpression recognizer

It carries parameters for the recognizer, mapping of vars to expressions and other information

Constructors

SEState 

Fields

Input type

data InputType Source #

Describes some math type

Instances
Eq InputType Source # 
Instance details

Defined in Recognize.SubExpr.SEParser

Show InputType Source # 
Instance details

Defined in Recognize.SubExpr.SEParser

determineInputType :: Expr -> InputType Source #

Determine the input type of the given expression

conformsTo :: Expr -> InputType -> Bool Source #

Given an expression, check whether it matches the specified input type.

resetAfter :: SEParser a -> SEParser a Source #

Reset the user state to dSEState after executing the parser

resetSEState :: SEParser SEState Source #

Reset the user state to dSEState. Returns the user state before resetting.