futhark-0.11.0: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone




Converting back and forth between PrimExps.



primExpToExp :: MonadBinder m => (v -> m (Exp (Lore m))) -> PrimExp v -> m (Exp (Lore m)) Source #

Convert a PrimExp to a Futhark expression. The provided function converts the leaves.

primExpFromExp :: (MonadFail m, Annotations lore) => (VName -> m (PrimExp v)) -> Exp lore -> m (PrimExp v) Source #

Convert an expression to a PrimExp. The provided function is used to convert expressions that are not trivially PrimExps. This includes constants and variable names, which are passed as BasicOps.

primExpFromSubExp :: PrimType -> SubExp -> PrimExp VName Source #

Convert BasicOps of a given type.

replaceInPrimExpM :: Monad m => (a -> PrimType -> m (PrimExp b)) -> PrimExp a -> m (PrimExp b) Source #

Applying a monadic transformation to the leaves in a PrimExp.

substituteInPrimExp :: Ord v => Map v (PrimExp v) -> PrimExp v -> PrimExp v Source #

Substituting names in a PrimExp with other PrimExps

Module reexport

Orphan instances

ToExp v => ToExp (PrimExp v) Source # 
Instance details


toExp :: MonadBinder m => PrimExp v -> m (Exp (Lore m)) Source #