improve :: Functor f => (forall m. MonadFree f m => m a) -> Free f a
improve m = lowerCodensity m
lowerCodensity :: Monad f => Codensity f a -> f a
The basic idea of improve is that the passed action does not depend on the choice of free monad construction (I don't actually remember why this matters, but that's the idea). The specific choice of Free f as the result monad, however, seems to be arbitrary. Thus
improve' :: (Functor f, MonadFree f m') =>
(forall m . MonadFree f m => m a) -> m' a
improve' m = lowerCodensity m
The basic idea of
improve
is that the passed action does not depend on the choice of free monad construction (I don't actually remember why this matters, but that's the idea). The specific choice ofFree f
as the result monad, however, seems to be arbitrary. Thus