1. An apparatus for compiling source code, comprising: a tokenizer for segmenting source code into a sequence of tagged segments; the source code including at least one instruction composing a first abstraction and a second abstraction with a selected composition operator; a parser for building a tree using the sequence of tagged segments; a type checker for performing a first pass of the tree to determine whether abstractions on the tree are well typed; a composer for reducing the at least one instruction composing the first and the second abstractions on the tree to a third abstraction; the composer substituting the first and the second abstractions on the tree with the third abstraction; wherein the type checker performs a second pass of the tree to determine whether the third abstraction is well typed.