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

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 Adj Source # 
Instance details

Defined in Futhark.AD.Rev.Monad

Substitute ArrayTransform Source # 
Instance details

Defined in Futhark.Analysis.HORep.SOAC

Substitute ArrayTransforms Source # 
Instance details

Defined in Futhark.Analysis.HORep.SOAC

Substitute Input Source # 
Instance details

Defined in Futhark.Analysis.HORep.SOAC

Substitute AliasDec Source # 
Instance details

Defined in Futhark.IR.Aliases

Substitute KernelGrid Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Substitute SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Substitute SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Substitute MemBind Source # 
Instance details

Defined in Futhark.IR.Mem

Substitute MemReturn Source # 
Instance details

Defined in Futhark.IR.Mem

Substitute FV Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Names Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute KernelResult Source # 
Instance details

Defined in Futhark.IR.SegOp

Substitute SubExpRes Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Attrs Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute Certs 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 SubExp Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute ExpWisdom Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Rep

Substitute VarWisdom Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Rep

Substitute VName Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute PrimType Source # 
Instance details

Defined in Futhark.Transform.Substitute

Substitute () Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

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

Substitute Bool Source # 
Instance details

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.IR.Mem.LMAD

Methods

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

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

Defined in Futhark.Transform.Substitute

ASTRep rep => Substitute (SOAC rep) Source # 
Instance details

Defined in Futhark.IR.SOACS.SOAC

Methods

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

ASTRep rep => Substitute (KernelBody rep) Source # 
Instance details

Defined in Futhark.IR.SegOp

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

Defined in Futhark.Transform.Substitute

Methods

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

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

Defined in Futhark.Transform.Substitute

Methods

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

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

Methods

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

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

Defined in Futhark.Transform.Substitute

Methods

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

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

Methods

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

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

Substitute d => Substitute (FlatSlice 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 dec => Substitute (PatElem dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

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

Defined in Futhark.Transform.Substitute

Methods

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

(ASTRep rep, Substitute (op rep)) => Substitute (HostOp op rep) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

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

(ASTRep rep, Substitute (op rep)) => Substitute (MCOp op rep) Source # 
Instance details

Defined in Futhark.IR.MC.Op

Methods

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

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

Defined in Futhark.IR.Mem

Methods

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

Substitute (NoOp rep) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> NoOp rep -> NoOp rep Source #

(ASTRep rep, Substitute lvl) => Substitute (SegOp lvl rep) Source # 
Instance details

Defined in Futhark.IR.SegOp

Methods

substituteNames :: Map VName VName -> SegOp lvl rep -> SegOp lvl rep 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 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 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.GPU.Sizes

Methods

substituteNames :: Map VName VName -> Count u e -> Count u e 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 (a, b, c) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> (a, b, c) -> (a, b, c) 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 rep = (RepTypes rep, Substitute (ExpDec rep), Substitute (BodyDec rep), Substitute (LetDec rep), Substitute (FParamInfo rep), Substitute (LParamInfo rep), Substitute (RetType rep), Substitute (BranchType rep), Substitute (Op rep)) Source #

Representations in which all annotations support name substitution.