| 42 | |

| 43 | = Linearity == |

| 44 | The real solution is to distinguish call demands from product demands. Consider again: |

| 45 | {{{ |

| 46 | let f = \ x. \ y. ... in |

| 47 | ...(f 1 2)...(f 3 4)... |

| 48 | }}} |

| 49 | The demands placed on {{{f}}} by the first and second call get bothed together to yield {{{SM(SM(T))}}}. But this is incorrect. Consider: |

| 50 | {{{ |

| 51 | let f = \ x. \ y. ... |

| 52 | frob = f 1 in |

| 53 | ...(f 1 2)...(frob 2)...(frob 3)... |

| 54 | }}} |

| 55 | Here, the demands placed on {{{f}}} by the body of {{{frob}}} and by the call to {{{f}}} in the {{{let}}}-body get bothed together: {{{S1(T) & S1(S1(T)) = SM(SM(T))}}}. Note that this is the same as the demand placed on {{{f}}} above, yet we want to distinguish between the two situations, because in the first example, the inner lambda in {{{f}}}'s rhs is only called once. |

| 56 | |

| 57 | The solution is to treat call demands and product demands differently, and to define the {{{both}}} function for call demands to have the same behavior as {{{lub}}}. Then in the first example, {{{f}}} has demand {{{SM(S1(T))}}} placed on it, and in the second, {{{SM(T)}}}. This is what we want; now, if {{{f}}} has demand {{{D(D(T)}}} placed on it, that implies {{{f}}} is always called with two arguments. |