Added complete version of the free monad design