Vectorise.Utils.Closure

ghc-7.0.4: The GHC API

Vectorise.Utils.Closure

Description

Utils concerning closure construction and application.

Synopsis

- mkClosure :: Type -> Type -> Type -> VExpr -> VExpr -> VM VExpr
- mkClosureApp :: Type -> Type -> VExpr -> VExpr -> VM VExpr
- buildClosure :: [TyVar] -> [VVar] -> Type -> Type -> VM VExpr -> VM VExpr
- buildClosures :: [TyVar] -> [VVar] -> [Type] -> Type -> VM VExpr -> VM VExpr
- buildEnv :: [VVar] -> VM (Type, VExpr, VExpr -> VExpr -> VExpr)

# Documentation

mkClosure

Arguments

:: Type | Type of the argument.
-> Type | Type of the result.
-> Type | Type of the environment.
-> VExpr | The function to apply.
-> VExpr | The environment to use.
-> VM VExpr |

Make a closure.

mkClosureApp

Arguments

:: Type | Type of the argument.
-> Type | Type of the result.
-> VExpr | Closure to apply.
-> VExpr | Argument to use.
-> VM VExpr |

Make a closure application.

buildClosure :: [TyVar] -> [VVar] -> Type -> Type -> VM VExpr -> VM VExpr

buildClosures

Arguments

:: [TyVar] |
-> [VVar] |
-> [Type] | Type of the arguments.
-> Type | Type of result.
-> VM VExpr |
-> VM VExpr |

buildEnv :: [VVar] -> VM (Type, VExpr, VExpr -> VExpr -> VExpr)