Type Propagation Example
Assume that the sum is the last component added; the following
- When the summand is selected, the type integer becomes the
accumulator type for the sum.
- The sum sends its accumulator type to find-update.
- find-update sends its accumulator type to alist.
- alist infers its element type (a combination of key and
accumulator) and its data structure type (a list of elements) and
sends its data structure type back to find-update.
- find-update sends the data structure type to iter-acc
as its accumulator type.
- iter-acc will declare a variable to hold the alist.