futhark-0.18.2: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.Analysis.Rephrase

Description

Facilities for changing the lore of some fragment, with no context. We call this "rephrasing", for no deep reason.

Synopsis

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.

rephraseBody :: Monad m => Rephraser m from to -> Body from -> m (Body to) Source #

Rephrase a body.

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.

rephrasePattern :: Monad m => (from -> m to) -> PatternT from -> m (PatternT to) Source #

Rephrase a pattern.

rephrasePatElem :: Monad m => (from -> m to) -> PatElemT from -> m (PatElemT 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 lore actually uses any Kernels-specific operations.

Constructors

Rephraser 

Fields