Programming abstractions with at least one expression are composed to a
single abstraction using a composition operator. Expressions from the
abstractions are unfolded by removing the prefix of each abstraction and
substituting formal parameter names in each expression with a common
parameter name to define open variables. The unfolded expressions are
transformed to a reduced expression using a composition pattern that
tunes semantics of the composition operators. The reduced expression is
nested in the single abstraction by: appending a selected prefix of the
composed abstraction to the reduced expression, binding the open
variables of the reduced expression to the formal parameter of the
selected prefix, and computing the type of the formal parameter of the
selected prefix.