Safe Haskell | None |
---|
Interpretation of binding constructs
- optimizeLambda :: (CLambda Type :<: dom, OptimizeSuper dom) => FeldOpts -> (ASTF (dom :|| Typeable) b -> Opt (ASTF (Decor Info (dom :|| Typeable)) b)) -> Info a -> CLambda Type (b :-> Full (a -> b)) -> Args (AST (dom :|| Typeable)) (b :-> Full (a -> b)) -> Opt (ASTF (Decor Info (dom :|| Typeable)) (a -> b))
- optimizeFunction :: ((Variable :|| Type) :<: dom, CLambda Type :<: dom, Let :<: dom, OptimizeSuper dom) => FeldOpts -> (ASTF (dom :|| Typeable) b -> Opt (ASTF (Decor Info (dom :|| Typeable)) b)) -> Info a -> ASTF (dom :|| Typeable) (a -> b) -> Opt (ASTF (Decor Info (dom :|| Typeable)) (a -> b))
- subst :: forall dom a b. (Constrained dom, CLambda Type :<: dom, (Variable :|| Type) :<: dom) => VarId -> ASTF (dom :|| Typeable) a -> ASTF (dom :|| Typeable) b -> ASTF (dom :|| Typeable) b
- betaReduce :: (Constrained dom, CLambda Type :<: dom, (Variable :|| Type) :<: dom) => ASTF (dom :|| Typeable) a -> ASTF (dom :|| Typeable) (a -> b) -> ASTF (dom :|| Typeable) b
- prjLambda :: Project (CLambda Type) dom => dom sig -> Maybe (CLambda Type sig)
- cLambda :: Type a => VarId -> CLambda Type (b :-> Full (a -> b))
- reuseCLambda :: CLambda Type (b :-> Full (a -> b)) -> CLambda Type (c :-> Full (a -> c))
- collectLetBinders :: forall dom a. (Project Let dom, Project (CLambda Type) dom, ConstrainedBy dom Typeable) => ASTF dom a -> ([(VarId, ASTB dom Type)], ASTF dom a)
Documentation
:: (CLambda Type :<: dom, OptimizeSuper dom) | |
=> FeldOpts | |
-> (ASTF (dom :|| Typeable) b -> Opt (ASTF (Decor Info (dom :|| Typeable)) b)) | Optimization of the body |
-> Info a | |
-> CLambda Type (b :-> Full (a -> b)) | |
-> Args (AST (dom :|| Typeable)) (b :-> Full (a -> b)) | |
-> Opt (ASTF (Decor Info (dom :|| Typeable)) (a -> b)) |
:: ((Variable :|| Type) :<: dom, CLambda Type :<: dom, Let :<: dom, OptimizeSuper dom) | |
=> FeldOpts | |
-> (ASTF (dom :|| Typeable) b -> Opt (ASTF (Decor Info (dom :|| Typeable)) b)) | Optimization of the body |
-> Info a | |
-> ASTF (dom :|| Typeable) (a -> b) -> Opt (ASTF (Decor Info (dom :|| Typeable)) (a -> b)) |
Assumes that the expression is a Lambda
reuseCLambda :: CLambda Type (b :-> Full (a -> b)) -> CLambda Type (c :-> Full (a -> c))Source
Allow an existing binding to be used with a body of a different type
collectLetBinders :: forall dom a. (Project Let dom, Project (CLambda Type) dom, ConstrainedBy dom Typeable) => ASTF dom a -> ([(VarId, ASTB dom Type)], ASTF dom a)Source
Collects the immediate let bindings in a list and returns the first non-let expression
This function can be useful when let bindings get in the way of pattern matching on a sub-expressions.