Initial attempt at free monad