Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- constantPropagationValue :: Data a => ProgramFile (Analysis a) -> ValueOf a
- type ValueOf a = Expression (Analysis a) -> CPValue
Documentation
constantPropagationValue :: Data a => ProgramFile (Analysis a) -> ValueOf a Source #
Given a ProgramFile
, return ValueOf
closure, which determines
whether given Expression
can be evaluated statically to a constant value using
constant propagation analysis.
Usage:
The best approach is to create a closure first as illustrated in the following
code example, so only one run of constant propragation analysis is performed
for a ProgramFile
.
let cpValueOf = constantPropagationValue pf ... in ... cpVauleOf e1 cpValueOf e2
type ValueOf a = Expression (Analysis a) -> CPValue Source #
ValueOf is a closure that takes an Expression
and deduces its CPValue