ajhc-0.8.0.8: Haskell compiler that produce binary through C language

Safe HaskellNone

E.Rules

Documentation

data ARules Source

Instances

Show ARules

ARules contains a set of rules for a single id, optimized for fast application

invarients for ARules sorted by number of arguments rule takes all hidden rule fields filled in free variables are up to date

Monoid ARules 
Binary ARules 
FreeVars ARules IdSet 

data Rule Source

Constructors

Rule TVr [TVr] [E] !Int E RuleType (Module, Int) Atom 

Instances

Eq Rule 
Show Rule 
Binary Rule 
FreeVars Rule IdSet

we delete the free variables of the heads of a rule from the rule's free variables. the reason for doing this is that the rule cannot fire if all its heads are in scope, and if it were not done then many functions seem recursive when they arn't actually.

FreeVars Rule [Id] 

newtype Rules Source

Constructors

Rules (IdMap [Rule]) 

applyRules :: MonadStats m => (Id -> Maybe E) -> ARules -> [E] -> m (Maybe (E, [E]))Source

builtinRule :: MonadStats m => TVr' t -> [E] -> m (Maybe (E, [E]))Source

dropArguments :: [(Int, E)] -> [Rule] -> [Rule]Source

mapRBodyArgs :: Monad m => (E -> m E) -> Rule -> m RuleSource

makeRuleSource

Arguments

:: String

the rule name

-> (Module, Int)

a unique name for this rule

-> RuleType

type of rule

-> [TVr]

the free variables

-> TVr

the head

-> [E]

the args

-> E

the body

-> Rule 

mapBodies :: Monad m => (E -> m E) -> Rules -> m RulesSource