Strictness analysis can be characterized as a forward abstract interpretation which approximates each function in the program by a function that maps divergence properties of the arguments onto divergence properties of the results. In the classical approach pioneered by Alan Mycroft, the abstract interpretation used a two-point domain with 0 denoting the set { ⊥ } {\displaystyle \{\bot \}} considered as a subset of the argument or return type, and 1 denoting all values in the type.1
The Glasgow Haskell Compiler (GHC) uses a backward abstract interpretation known as demand analysis to perform strictness analysis as well as other program analyses. In demand analysis, each function is modelled by a function from value demands on the result to value demands on the arguments. A function is strict in an argument if a demand for its result leads to a demand for that argument.2
Projection-based strictness analysis, introduced by Philip Wadler and R.J.M. Hughes, uses strictness projections to model more subtle forms of strictness, such as head-strictness in a list argument. (By contrast, GHC's demand analysis can only model strictness within product types, i.e., datatypes that only have a single constructor.) A function f {\displaystyle f} is considered head-strict if f = f ∘ π {\displaystyle f=f\circ \pi } , where π {\displaystyle \pi } is the projection that head-evaluates its list argument.3
There was a large body of research on strictness analysis in the 1980s.
Mycroft, Alan (1980). "The theory and practice of transforming call-by-need into call-by-value". Lecture Notes in Computer Science: Proc. 4th Intl. Symp. on Programming, Vol. 83. Springer-Verlag. ↩
"The GHC Commentary: Demand analyser in GHC". Retrieved 2014-02-12. https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Demand ↩
Wadler, P.; R.J.M. Hughes (1987). "Projections for strictness analysis". Functional programming and computer architecture; LNCS 274. Springer-Verlag. ↩