Safe Haskell | None |
---|---|
Language | Haskell98 |
Pattern matches on algebra plans.
- newtype Match o p e a = M (MaybeT (Reader (Env o p e)) a)
- runMatch :: e -> AlgebraDag o -> NodeMap p -> Match o p e a -> Maybe a
- getParents :: AlgNode -> Match o p e [AlgNode]
- getOperator :: Operator o => AlgNode -> Match o p e o
- hasPath :: AlgNode -> AlgNode -> Match o p e Bool
- getRootNodes :: Match o p e [AlgNode]
- predicate :: Bool -> Match o p e ()
- try :: Maybe a -> Match o p e a
- matchOp :: Operator o => AlgNode -> (o -> Match o p e a) -> Match o p e a
- lookupExtras :: Match o p e e
- exposeEnv :: Match o p e (AlgebraDag o, NodeMap p, e)
- properties :: AlgNode -> Match o p e p
Documentation
The Match monad models the failing of a match and provides limited read-only access to the DAG.
runMatch :: e -> AlgebraDag o -> NodeMap p -> Match o p e a -> Maybe a Source
Runs a match on the supplied DAG. If the Match fails, Nothing
is returned. If the Match succeeds, it returns just the result.
getParents :: AlgNode -> Match o p e [AlgNode] Source
Returns the parents of a node in a Match context.
getOperator :: Operator o => AlgNode -> Match o p e o Source
getRootNodes :: Match o p e [AlgNode] Source
matchOp :: Operator o => AlgNode -> (o -> Match o p e a) -> Match o p e a Source
Runs the supplied Match action on the operator that belongs to the given node.
lookupExtras :: Match o p e e Source
exposeEnv :: Match o p e (AlgebraDag o, NodeMap p, e) Source
properties :: AlgNode -> Match o p e p Source
Look up the properties for a given node.