Safe Haskell | None |
---|---|
Language | Haskell2010 |
The code generator cannot handle the array combinators (map
and
friends), so this module was written to transform them into the
equivalent do-loops. The transformation is currently rather naive,
and - it's certainly worth considering when we can express such
transformations in-place.
Synopsis
- transformFunDef :: (MonadFreshNames m, FirstOrderLore tolore) => Scope tolore -> FunDef SOACS -> m (FunDef tolore)
- transformStms :: (MonadFreshNames m, FirstOrderLore tolore) => Stms SOACS -> m (Stms tolore)
- type FirstOrderLore lore = (Bindable lore, BinderOps lore, LetAttr SOACS ~ LetAttr lore, LParamAttr SOACS ~ LParamAttr lore, CanBeAliased (Op lore))
- type Transformer m = (MonadBinder m, LocalScope (Lore m) m, Bindable (Lore m), BinderOps (Lore m), LParamAttr SOACS ~ LParamAttr (Lore m), CanBeAliased (Op (Lore m)))
- transformStmRecursively :: (Transformer m, LetAttr (Lore m) ~ LetAttr SOACS) => Stm -> m ()
- transformLambda :: (MonadFreshNames m, Bindable lore, BinderOps lore, LocalScope somelore m, SameScope somelore lore, LetAttr lore ~ LetAttr SOACS, CanBeAliased (Op lore)) => Lambda -> m (Lambda lore)
- transformSOAC :: Transformer m => Pattern (Lore m) -> SOAC (Lore m) -> m ()
- transformBody :: (Transformer m, LetAttr (Lore m) ~ LetAttr SOACS) => Body -> m (Body (Lore m))
Documentation
transformFunDef :: (MonadFreshNames m, FirstOrderLore tolore) => Scope tolore -> FunDef SOACS -> m (FunDef tolore) Source #
transformStms :: (MonadFreshNames m, FirstOrderLore tolore) => Stms SOACS -> m (Stms tolore) Source #
type FirstOrderLore lore = (Bindable lore, BinderOps lore, LetAttr SOACS ~ LetAttr lore, LParamAttr SOACS ~ LParamAttr lore, CanBeAliased (Op lore)) Source #
The constraints that must hold for a lore in order to be the target of first-order transformation.
type Transformer m = (MonadBinder m, LocalScope (Lore m) m, Bindable (Lore m), BinderOps (Lore m), LParamAttr SOACS ~ LParamAttr (Lore m), CanBeAliased (Op (Lore m))) Source #
The constraints that a monad must uphold in order to be used for first-order transformation.
transformStmRecursively :: (Transformer m, LetAttr (Lore m) ~ LetAttr SOACS) => Stm -> m () Source #
First transform any nested Body
or Lambda
elements, then
apply transformSOAC
if the expression is a SOAC.
transformLambda :: (MonadFreshNames m, Bindable lore, BinderOps lore, LocalScope somelore m, SameScope somelore lore, LetAttr lore ~ LetAttr SOACS, CanBeAliased (Op lore)) => Lambda -> m (Lambda lore) Source #
Recursively first-order-transform a lambda.
transformSOAC :: Transformer m => Pattern (Lore m) -> SOAC (Lore m) -> m () Source #