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

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

Recognize.Data.Op

Description

 
Synopsis

Documentation

data Op Source #

Describe how to expand a formula

Constructors

Add Expr 
Sub Expr 
Mul Expr 
Div Expr 
Instances
Eq Op Source # 
Instance details

Defined in Recognize.Data.Op

Methods

(==) :: Op -> Op -> Bool #

(/=) :: Op -> Op -> Bool #

Ord Op Source # 
Instance details

Defined in Recognize.Data.Op

Methods

compare :: Op -> Op -> Ordering #

(<) :: Op -> Op -> Bool #

(<=) :: Op -> Op -> Bool #

(>) :: Op -> Op -> Bool #

(>=) :: Op -> Op -> Bool #

max :: Op -> Op -> Op #

min :: Op -> Op -> Op #

Read Op Source # 
Instance details

Defined in Recognize.Data.Op

Show Op Source # 
Instance details

Defined in Recognize.Data.Op

Methods

showsPrec :: Int -> Op -> ShowS #

show :: Op -> String #

showList :: [Op] -> ShowS #

Arbitrary Op Source # 
Instance details

Defined in Recognize.Data.Op

Methods

arbitrary :: Gen Op #

shrink :: Op -> [Op] #

ToXML Op Source # 
Instance details

Defined in Recognize.Data.Op

Methods

toXML :: Op -> XML #

listToXML :: [Op] -> XML #

InXML Op Source # 
Instance details

Defined in Recognize.Data.Op

Methods

fromXML :: Monad m => XML -> m Op #

listFromXML :: Monad m => XML -> m [Op] #

fromOp :: Op -> Expr -> Expr Source #

Apply an Op to and Expr

fromOp' :: Op -> Expr -> Expr Source #

fromOp' op e applies operator op in the most bottom-right term (when op = div/mul) of e. eg: fromOp' (3) (4 + 2) = (4 + 23)

fromOps :: [Op] -> Expr -> Expr Source #

formExpr :: Expr -> Expr -> [Op] -> Expr Source #