Added Free monad version, though not tested yet (it just compiles).