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

Futhark.Transform.Substitute

Description

This module contains facilities for replacing variable names in syntactic constructs.

Synopsis

Documentation

type Substitutions = Map VName VName Source #

The substitutions to be made are given by a mapping from names to names.

class Substitute a where Source #

A type that is an instance of this class supports substitution of any names contained within.

Methods

substituteNames :: Map VName VName -> a -> a Source #

substituteNames m e replaces the variable names in e with new names, based on the mapping in m. It is assumed that all names in e are unique, i.e. there is no shadowing.

Instances

Instances details
Substitute Bool Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute () Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> () -> () Source #

Substitute PrimType Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute VName Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute SubExp Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Certificates Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Ident Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Rank Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Attrs Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute FV Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Names Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute AliasDec Source # 
Instance details

Defined in Futhark.IR.Aliases

Substitute ExpWisdom Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Lore

Substitute VarWisdom Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Lore

Substitute MemReturn Source # 
Instance details

Defined in Futhark.IR.Mem

Substitute MemBind Source # 
Instance details

Defined in Futhark.IR.Mem

Substitute KernelResult Source # 
Instance details

Defined in Futhark.IR.SegOp

Substitute SplitOrdering Source # 
Instance details

Defined in Futhark.IR.SegOp

Substitute SizeOp Source # 
Instance details

Defined in Futhark.IR.Kernels.Kernel

Substitute SegLevel Source # 
Instance details

Defined in Futhark.IR.Kernels.Kernel

Substitute Input Source # 
Instance details

Defined in Futhark.Analysis.HORep.SOAC

Substitute ArrayTransforms Source # 
Instance details

Defined in Futhark.Analysis.HORep.SOAC

Substitute ArrayTransform Source # 
Instance details

Defined in Futhark.Analysis.HORep.SOAC

Substitute a => Substitute [a] Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> [a] -> [a] Source #

Substitute a => Substitute (Maybe a) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute dec => Substitute (PatElemT dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute d => Substitute (DimIndex d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute dec => Substitute (Param dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Param dec -> Param dec Source #

Substitute d => Substitute (Ext d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute d => Substitute (ShapeBase d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitutable lore => Substitute (Lambda lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Lambda lore -> Lambda lore Source #

Substitutable lore => Substitute (Exp lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Exp lore -> Exp lore Source #

Substitute d => Substitute (DimChange d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitutable lore => Substitute (Body lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Body lore -> Body lore Source #

Substitute (Stm lore) => Substitute (Stms lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Stms lore -> Stms lore Source #

Substitutable lore => Substitute (Stm lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Stm lore -> Stm lore Source #

Substitute dec => Substitute (StmAux dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute dec => Substitute (PatternT dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitutable lore => Substitute (NameInfo lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

Substitute num => Substitute (IxFun num) Source # 
Instance details

Defined in Futhark.IR.Mem.IxFun

Methods

substituteNames :: Map VName VName -> IxFun num -> IxFun num Source #

Substitute num => Substitute (LMAD num) Source # 
Instance details

Defined in Futhark.IR.Mem.IxFun

Methods

substituteNames :: Map VName VName -> LMAD num -> LMAD num Source #

ASTLore lore => Substitute (SOAC lore) Source # 
Instance details

Defined in Futhark.IR.SOACS.SOAC

Methods

substituteNames :: Map VName VName -> SOAC lore -> SOAC lore Source #

Substitute inner => Substitute (MemOp inner) Source # 
Instance details

Defined in Futhark.IR.Mem

Methods

substituteNames :: Map VName VName -> MemOp inner -> MemOp inner Source #

ASTLore lore => Substitute (KernelBody lore) Source # 
Instance details

Defined in Futhark.IR.SegOp

(Substitute a, Substitute b) => Substitute (a, b) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> (a, b) -> (a, b) Source #

Substitute shape => Substitute (TypeBase shape u) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> TypeBase shape u -> TypeBase shape u Source #

Substitute v => Substitute (TPrimExp t v) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute e => Substitute (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

substituteNames :: Map VName VName -> Count u e -> Count u e Source #

(ASTLore lore, Substitute lvl) => Substitute (SegOp lvl lore) Source # 
Instance details

Defined in Futhark.IR.SegOp

Methods

substituteNames :: Map VName VName -> SegOp lvl lore -> SegOp lvl lore Source #

(ASTLore lore, Substitute op) => Substitute (MCOp lore op) Source # 
Instance details

Defined in Futhark.IR.MC.Op

Methods

substituteNames :: Map VName VName -> MCOp lore op -> MCOp lore op Source #

(ASTLore lore, Substitute op) => Substitute (HostOp lore op) Source # 
Instance details

Defined in Futhark.IR.Kernels.Kernel

Methods

substituteNames :: Map VName VName -> HostOp lore op -> HostOp lore op Source #

(Substitute a, Substitute b, Substitute c) => Substitute (a, b, c) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> (a, b, c) -> (a, b, c) Source #

(Substitute d, Substitute ret) => Substitute (MemInfo d u ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Methods

substituteNames :: Map VName VName -> MemInfo d u ret -> MemInfo d u ret Source #

(Substitute a, Substitute b, Substitute c, Substitute d) => Substitute (a, b, c, d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> (a, b, c, d) -> (a, b, c, d) Source #

type Substitutable lore = (Decorations lore, Substitute (ExpDec lore), Substitute (BodyDec lore), Substitute (LetDec lore), Substitute (FParamInfo lore), Substitute (LParamInfo lore), Substitute (RetType lore), Substitute (BranchType lore), Substitute (Op lore)) Source #

Lores in which all annotations support name substitution.