Constant Value | Function Int (Value -> Function)
. Applying a Function to a Value always results in another Function. If the Function has arity 1, the result is a Constant; applying a Constant leaves it unchanged. The neat thing about this approach is that I can make Function an instance of Monoid (which I just read about). Function composition is just mappend
, and function application is just composition with a Constant.