Safe Haskell | Safe-Inferred |
---|
Annotate let bindings with how their bound variables are used.
- data Used
- = UsedFunction
- | UsedDestruct
- | UsedInCast
- | UsedOcc
- | UsedInLambda Used
- | UsedInAlt Used
- data UsedMap n = UsedMap (Map n [Used])
- usageModule :: Ord n => Module a n -> Module (UsedMap n, a) n
- usageX :: Ord n => Exp a n -> Exp (UsedMap n, a) n
Usage map
Tracks how a bound variable is used.
UsedFunction | Bound variable is used as the function of an application. |
UsedDestruct | Bound variable is destructed by a case-expression. |
UsedInCast | Bound variable is used inside a |
UsedOcc | Bound variable has an occurrence that is not one of the above. |
UsedInLambda Used | Usage is inside a Lambda abstraction (either type or value) |
UsedInAlt Used | Usage is inside a case alternative. |
Map of bound name to how the variable is used.