katydid- A haskell implementation of Katydid

Safe HaskellSafe



This is an internal relapse module.

It contains multiple implementations of if expressions.



data IfExprs Source #

IfExprs is a tree of if expressions, which contains a list of resulting patterns on each of its leaves.

data IfExpr Source #

IfExpr contains a condition and a return pattern for each of the two cases.

newIfExpr :: Expr Bool -> Pattern -> Pattern -> IfExpr Source #

newIfExpr creates an IfExpr.

evalIfExprs :: IfExprs -> Label -> Either String [Pattern] Source #

valIfExprs evaluates a tree of if expressions and returns the resulting patterns or an error.

compileIfExprs :: [IfExpr] -> IfExprs Source #

compileIfExprs compiles a list of if expressions in an IfExprs tree, for efficient evaluation.

data ZippedIfExprs Source #

ZippedIfExprs is a tree of if expressions, but with a zipped pattern list and a zipper on each of the leaves.

zipIfExprs :: IfExprs -> ZippedIfExprs Source #

zipIfExprs compresses an if expression tree's leaves.

evalZippedIfExprs :: ZippedIfExprs -> Label -> Either String ([Pattern], Zipper) Source #

evalZippedIfExprs evaulates a ZippedIfExprs tree and returns the zipped pattern list and zipper from the resulting leaf.