futhark-0.15.5: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Futhark.Pass

Description

Definition of a polymorphic (generic) pass that can work with programs of any lore.

Synopsis

Documentation

data PassM a Source #

The monad in which passes execute.

Instances

Instances details
Monad PassM Source # 
Instance details

Defined in Futhark.Pass

Methods

(>>=) :: PassM a -> (a -> PassM b) -> PassM b #

(>>) :: PassM a -> PassM b -> PassM b #

return :: a -> PassM a #

Functor PassM Source # 
Instance details

Defined in Futhark.Pass

Methods

fmap :: (a -> b) -> PassM a -> PassM b #

(<$) :: a -> PassM b -> PassM a #

Applicative PassM Source # 
Instance details

Defined in Futhark.Pass

Methods

pure :: a -> PassM a #

(<*>) :: PassM (a -> b) -> PassM a -> PassM b #

liftA2 :: (a -> b -> c) -> PassM a -> PassM b -> PassM c #

(*>) :: PassM a -> PassM b -> PassM b #

(<*) :: PassM a -> PassM b -> PassM a #

MonadLogger PassM Source # 
Instance details

Defined in Futhark.Pass

Methods

logMsg :: ToLog a => a -> PassM () Source #

addLog :: Log -> PassM () Source #

MonadFreshNames PassM Source # 
Instance details

Defined in Futhark.Pass

runPassM :: MonadFreshNames m => PassM a -> m (a, Log) Source #

Execute a PassM action, yielding logging information and either an error text or a result.

liftEither :: Show err => Either err a -> PassM a Source #

Turn an Either computation into a PassM. If the Either is Left, the result is a CompilerBug.

liftEitherM :: Show err => PassM (Either err a) -> PassM a Source #

Turn an Either monadic computation into a PassM. If the Either is Left, the result is an exception.

data Pass fromlore tolore Source #

A compiler pass transforming a Prog of a given lore to a Prog of another lore.

Constructors

Pass 

Fields

passLongOption :: Pass fromlore tolore -> String Source #

Take the name of the pass, turn spaces into dashes, and make all characters lowercase.

parPass :: (a -> PassM b) -> [a] -> PassM [b] Source #

Apply a PassM operation in parallel to multiple elements, joining together the name sources and logs, and propagating any error properly.

intraproceduralTransformation :: (Scope lore -> Stms lore -> PassM (Stms lore)) -> Prog lore -> PassM (Prog lore) Source #

intraproceduralTransformationWithConsts :: (Stms fromlore -> PassM (Stms tolore)) -> (Stms tolore -> FunDef fromlore -> PassM (FunDef tolore)) -> Prog fromlore -> PassM (Prog tolore) Source #