Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Facilities for changing the representation of some fragment, within a monadic context. We call this "rephrasing", for no deep reason.
Synopsis
- rephraseProg :: Monad m => Rephraser m from to -> Prog from -> m (Prog to)
- rephraseFunDef :: Monad m => Rephraser m from to -> FunDef from -> m (FunDef to)
- rephraseExp :: Monad m => Rephraser m from to -> Exp from -> m (Exp to)
- rephraseBody :: Monad m => Rephraser m from to -> Body from -> m (Body to)
- rephraseStm :: Monad m => Rephraser m from to -> Stm from -> m (Stm to)
- rephraseLambda :: Monad m => Rephraser m from to -> Lambda from -> m (Lambda to)
- rephrasePat :: Monad m => (from -> m to) -> Pat from -> m (Pat to)
- rephrasePatElem :: Monad m => (from -> m to) -> PatElem from -> m (PatElem to)
- data Rephraser m from to = Rephraser {
- rephraseExpDec :: ExpDec from -> m (ExpDec to)
- rephraseLetBoundDec :: LetDec from -> m (LetDec to)
- rephraseFParamDec :: FParamInfo from -> m (FParamInfo to)
- rephraseLParamDec :: LParamInfo from -> m (LParamInfo to)
- rephraseBodyDec :: BodyDec from -> m (BodyDec to)
- rephraseRetType :: RetType from -> m (RetType to)
- rephraseBranchType :: BranchType from -> m (BranchType to)
- rephraseOp :: Op from -> m (Op to)
- class RephraseOp op where
- rephraseInOp :: Monad m => Rephraser m from to -> op from -> m (op to)
Documentation
rephraseProg :: Monad m => Rephraser m from to -> Prog from -> m (Prog to) Source #
Rephrase an entire program.
rephraseFunDef :: Monad m => Rephraser m from to -> FunDef from -> m (FunDef to) Source #
Rephrase a function definition.
rephraseExp :: Monad m => Rephraser m from to -> Exp from -> m (Exp to) Source #
Rephrase an expression.
rephraseStm :: Monad m => Rephraser m from to -> Stm from -> m (Stm to) Source #
Rephrase a statement.
rephraseLambda :: Monad m => Rephraser m from to -> Lambda from -> m (Lambda to) Source #
Rephrase a lambda.
rephrasePatElem :: Monad m => (from -> m to) -> PatElem from -> m (PatElem to) Source #
Rephrase a pattern element.
data Rephraser m from to Source #
A collection of functions that together allow us to rephrase some
IR fragment, in some monad m
. If we let m
be the Maybe
monad, we can conveniently do rephrasing that might fail. This is
useful if you want to see if some IR in e.g. the Kernels
rep
actually uses any Kernels
-specific operations.
Rephraser | |
|
class RephraseOp op where Source #
Rephrasing any fragments inside an Op from one representation to another.
rephraseInOp :: Monad m => Rephraser m from to -> op from -> m (op to) Source #
Instances
RephraseOp SOAC Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
RephraseOp op => RephraseOp (HostOp op) Source # | |
Defined in Futhark.IR.GPU.Op | |
RephraseOp op => RephraseOp (MCOp op) Source # | |
Defined in Futhark.IR.MC.Op | |
RephraseOp inner => RephraseOp (MemOp inner) Source # | |
Defined in Futhark.IR.Mem | |
RephraseOp (NoOp :: Type -> Type) Source # | |
Defined in Futhark.IR.Rephrase | |
RephraseOp (SegOp lvl) Source # | |
Defined in Futhark.IR.SegOp |