Feldspar.Core.Constructs.Binding

feldspar-language-0.6.0.2: A functional embedded language for DSP and parallelism

Safe Haskell | None

Feldspar.Core.Constructs.Binding

Description

Interpretation of binding constructs

Synopsis

- module Language.Syntactic.Constructs.Binding
- optimizeLambda :: (CLambda Type :<: dom, OptimizeSuper dom) => (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 :: (CLambda Type :<: dom, OptimizeSuper dom) => (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))
- prjLambda :: Project (CLambda Type) dom => dom sig -> Maybe (CLambda Type sig)
- betaReduce :: (Constrained dom, CLambda Type :<: dom, (Variable :|| Type) :<: dom) => ASTF (dom :|| Typeable) a -> ASTF (dom :|| Typeable) (a -> b) -> ASTF (dom :|| Typeable) b
- cLambda :: Type a => VarId -> CLambda Type (b :-> Full (a -> b))

# Documentation

module Language.Syntactic.Constructs.Binding

optimizeLambda

Arguments

:: (CLambda Type :<: dom, OptimizeSuper dom) |
=> (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)) |

optimizeFunction

Arguments

:: (CLambda Type :<: dom, OptimizeSuper dom) |
=> (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`

prjLambda :: Project (CLambda Type) dom => dom sig -> Maybe (CLambda Type sig)

betaReduce

Arguments

:: (Constrained dom, CLambda Type :<: dom, (Variable :|| Type) :<: dom) |
=> ASTF (dom :|| Typeable) a | Argument
-> ASTF (dom :|| Typeable) (a -> b) | Function to be reduced
-> ASTF (dom :|| Typeable) b |

cLambda :: Type a => VarId -> CLambda Type (b :-> Full (a -> b))