Safe Haskell | None |
---|---|
Language | Haskell2010 |
Facilities for determining which names are used in some syntactic
construct. The most important interface is the FreeIn
class and
its instances, but for reasons related to the Haskell type system,
some constructs have specialised functions.
Synopsis
- class FreeIn a where
- type Names = Set VName
- freeInStmsAndRes :: (FreeIn (Op lore), FreeIn (LetAttr lore), FreeIn (LParamAttr lore), FreeIn (FParamAttr lore), FreeAttr (BodyAttr lore), FreeAttr (ExpAttr lore)) => Stms lore -> Result -> Names
- freeInBody :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Body lore -> Names
- freeInExp :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Exp lore -> Names
- freeInStm :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Stm lore -> Names
- freeInLambda :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Lambda lore -> Names
- boundInBody :: Body lore -> Names
- boundByStm :: Stm lore -> Names
- boundByStms :: Stms lore -> Names
- boundByLambda :: Lambda lore -> [VName]
- class FreeIn attr => FreeAttr attr where
- precomputed :: attr -> Names -> Names
Class
A class indicating that we can obtain free variable information from values of this type.
Instances
Specialised Functions
freeInStmsAndRes :: (FreeIn (Op lore), FreeIn (LetAttr lore), FreeIn (LParamAttr lore), FreeIn (FParamAttr lore), FreeAttr (BodyAttr lore), FreeAttr (ExpAttr lore)) => Stms lore -> Result -> Names Source #
Return the set of variable names that are free in the given statements and result. Filters away the names that are bound by the statements.
freeInBody :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Body lore -> Names Source #
Return the set of variable names that are free in the given body.
freeInExp :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Exp lore -> Names Source #
Return the set of variable names that are free in the given expression.
freeInStm :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Stm lore -> Names Source #
Return the set of variable names that are free in the given binding.
freeInLambda :: (FreeAttr (ExpAttr lore), FreeAttr (BodyAttr lore), FreeIn (FParamAttr lore), FreeIn (LParamAttr lore), FreeIn (LetAttr lore), FreeIn (Op lore)) => Lambda lore -> Names Source #
Return the set of variable names that are free in the given lambda, including shape annotations in the parameters.
Bound Names
boundByStm :: Stm lore -> Names Source #
The names bound by a binding.
boundByStms :: Stms lore -> Names Source #
The names bound by the bindings.
boundByLambda :: Lambda lore -> [VName] Source #
The names of the lambda parameters plus the index parameter.
class FreeIn attr => FreeAttr attr where Source #
Either return precomputed free names stored in the attribute, or the freshly computed names. Relies on lazy evaluation to avoid the work.
Nothing
precomputed :: attr -> Names -> Names Source #
Instances
FreeAttr () Source # | |
Defined in Futhark.Representation.AST.Attributes.Names precomputed :: () -> Names -> Names Source # | |
FreeAttr KnownBound Source # | |
Defined in Futhark.Representation.AST.Attributes.Ranges precomputed :: KnownBound -> Names -> Names Source # | |
FreeAttr Names' Source # | |
Defined in Futhark.Representation.Aliases | |
FreeAttr ExpWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Lore | |
FreeAttr a => FreeAttr [a] Source # | |
Defined in Futhark.Representation.AST.Attributes.Names precomputed :: [a] -> Names -> Names Source # | |
FreeAttr a => FreeAttr (Maybe a) Source # | |
Defined in Futhark.Representation.AST.Attributes.Names | |
(FreeAttr a, FreeIn b) => FreeAttr (a, b) Source # | |
Defined in Futhark.Representation.AST.Attributes.Names precomputed :: (a, b) -> Names -> Names Source # |