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

Safe HaskellNone
LanguageHaskell2010

HERMIT.Dictionary.Local

Contents

Synopsis

Local Structural Manipulations

externals :: [External] Source

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

Binding Groups

Case Expressions

Cast Expressions

Let Expressions

Miscellaneous

abstractR :: (ReadBindings c, MonadCatch m, MonadUnique m) => (Var -> Bool) -> Rewrite c m CoreExpr Source

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

pushR Source

Arguments

:: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c) 
=> Maybe (Rewrite c HermitM CoreExpr)

a proof that the function (after being applied to its type arguments) is strict

-> (Id -> Bool)

a predicate to identify the function

-> Rewrite c HermitM CoreExpr 

Push a function through a Case or Let expression. Unsafe if the function is not strict.

betaReduceR :: MonadCatch m => Rewrite c m CoreExpr Source

((\ 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).

betaExpandR :: MonadCatch m => Rewrite c m CoreExpr Source

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

etaReduceR :: MonadCatch m => Rewrite c m CoreExpr Source

(\ v -> f v) ==> f

etaExpandR :: String -> Rewrite c HermitM CoreExpr Source

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

multiEtaExpandR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c) => [String] -> Rewrite c HermitM CoreExpr Source

Perform multiple eta-expansions.

flattenModuleR :: (ExtendPath c Crumb, HasEmptyContext c, Monad m) => Rewrite c m ModGuts Source

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

flattenProgramR :: Monad m => Rewrite c m CoreProg Source

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

flattenProgramT :: Monad m => Transform c m CoreProg CoreBind Source

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