MonadFix instance for interpreter monad transformer generated by FreeT?
问题 I have a simplified version of the standard interpreter monad transformer generated by FreeT : data InteractiveF p r a = Interact p (r -> a) type Interactive p r = FreeT (InteractiveF p r) p is the "prompt", and r is the "environment"...one would run this using something like: runInteractive :: Monad m => (p -> m r) -> Interactive p r m a -> m a runInteractive prompt iact = do ran <- runFreeT iact case ran of Pure x -> return x Free (Interact p f) -> do response <- prompt p runInteractive