Use a Free monad for generating type conversions