hermit-0.1.4.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone

Language.HERMIT.Primitive.Local

Contents

Synopsis

Local Structural Manipulations

externals :: [External]Source

Externals for local structural manipulations. (Many taken from Chapter 3 of Andre Santos' dissertation.)

Let Expressions

Case Expressions

Miscellaneous

abstract :: Name -> RewriteH CoreExprSource

Abstract over a variable using a lambda. e ==> ( x. e) x

nonrecToRec :: RewriteH CoreBindSource

NonRec v e ==> Rec [Def v e]

betaReduce :: RewriteH CoreExprSource

((\ v -> e1) e2) ==> (let v = e2 in e1) This form of beta-reduction is safe if e2 is an arbitrary expression (won't duplicate work).

betaReducePlus :: RewriteH CoreExprSource

Perform one or more beta-reductions.

betaExpand :: RewriteH CoreExprSource

(let v = e1 in e2) ==> (\ v -> e2) e1

etaReduce :: RewriteH CoreExprSource

(\ v -> e1 v) ==> e1

etaExpand :: Name -> RewriteH CoreExprSource

e1 ==> (\ v -> e1 v)

multiEtaExpand :: [Name] -> RewriteH CoreExprSource

Perform multiple eta-expansions.

flattenModule :: RewriteH ModGutsSource

Flatten all the top-level binding groups in the module to a single recursive binding group.

flattenProgramR :: RewriteH CoreProgSource

Flatten all the top-level binding groups in a program to a program containing a single recursive binding group.

flattenProgramT :: TranslateH CoreProg CoreBindSource

Flatten all the top-level binding groups in a program to a single recursive binding group.