Safe Haskell | None |
---|---|
Language | Haskell2010 |
Definition of a polymorphic (generic) pass that can work with programs of any lore.
Synopsis
- data PassM a
- runPassM :: MonadFreshNames m => PassM a -> m (Either InternalError a, Log)
- liftEither :: Show err => Either err a -> PassM a
- liftEitherM :: Show err => PassM (Either err a) -> PassM a
- data Pass fromlore tolore = Pass {
- passName :: String
- passDescription :: String
- passFunction :: Prog fromlore -> PassM (Prog tolore)
- passLongOption :: Pass fromlore tolore -> String
- intraproceduralTransformation :: (FunDef fromlore -> PassM (FunDef tolore)) -> Prog fromlore -> PassM (Prog tolore)
Documentation
The monad in which passes execute.
Instances
Monad PassM Source # | |
Functor PassM Source # | |
Applicative PassM Source # | |
MonadLogger PassM Source # | |
MonadFreshNames PassM Source # | |
Defined in Futhark.Pass getNameSource :: PassM VNameSource Source # putNameSource :: VNameSource -> PassM () Source # | |
MonadError InternalError PassM Source # | |
Defined in Futhark.Pass throwError :: InternalError -> PassM a # catchError :: PassM a -> (InternalError -> PassM a) -> PassM a # |
runPassM :: MonadFreshNames m => PassM a -> m (Either InternalError 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
.
data Pass fromlore tolore Source #
Pass | |
|
passLongOption :: Pass fromlore tolore -> String Source #
Take the name of the pass, turn spaces into dashes, and make all characters lowercase.