Changes between Version 7 and Version 8 of Commentary/Compiler/Demand
 Timestamp:
 Oct 3, 2012 1:32:55 PM (2 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Commentary/Compiler/Demand
v7 v8 38 38 Strictness demands 39 39 40 * `B`  a ''hyperstrict'' demand. The expression `e` puts this demand on its argument `x` if every evaluation of `e` is guaranteed to diverge, regardless of the value of the argument. We call this demand ''hyperstrict'' because it is safe to evaluate `x` to arbitrary depth before evaluating `e`. 40 * `B`  a ''hyperstrict'' demand. The expression `e` puts this demand on its argument `x` if every evaluation of `e` is guaranteed to diverge, regardless of the value of the argument. We call this demand ''hyperstrict'' because it is safe to evaluate `x` to arbitrary depth before evaluating `e`. This demand is polymorphic with respect to function calls and can be seen as `B = C(B) = C(C(B)) = ...` for an arbitrary depth. 41 41 42 42 * `L`  a ''lazy'' demand. If an expression `e` places demand `L` on a variable `x`, we can deduce nothing about how `e` uses `x`. `L` is the completely uninformative demand, the top element of the lattice. 43 43 44 * `S`  a ''headstrict'' demand. If `e` places demand `S` on `x` then `e` evaluates `x` to at least headnormal form; that is, to the outermost constructor of `x`. Th e demand `S(L ... L)` places a lazy demand on all the components, and so is equivalent to `S`; hence the identity `S = S(L ... L)`.44 * `S`  a ''headstrict'' demand. If `e` places demand `S` on `x` then `e` evaluates `x` to at least headnormal form; that is, to the outermost constructor of `x`. This demand is typically placed by the `seq` function on its first argument. The demand `S(L ... L)` places a lazy demand on all the components, and so is equivalent to `S`; hence the identity `S = S(L ... L)`. Another identity is for functions, which states that `S = C(L)`. Indeed, if a function is certainly called, it is evaluated at lest up to the head normal form, i.e., ''strictly''. However, its result may be used lazily. 45 45 46 46 * `S(s1 ... sn)`  a structured strictness demand on a product. It is at least headstrict, and perhaps more. … … 49 49 50 50 51 Absence demands51 Absence/usage demands 52 52 53 53 * `A`  when placed on a binder `x` it means that `x` is definitely unused. … … 55 55 * `U`  the value is used on some execution path. This demand is a top of usage domain. 56 56 57 * `H`  a ''headused'' demand. Indicates that a product value is used itself, however its components are certainly ignored. 57 * `H`  a ''headused'' demand. Indicates that a product value is used itself, however its components are certainly ignored. This demand is typically placed by the `seq` function on its first argument. This demand is polymorphic with respect to products and functions. For a product, the headused demand is expanded as `U(A, ..., A)` and for functions it can be read as `C(A)`, as the function is called (i.e., evaluated to at least a headnormal form), but its result is ignored. 58 58 59 59 * `U(u1 ... un)`  a structured usage demand on a product. It is at least headused, and perhaps more.