Lifting a higher order function in Haskell
问题 I\'m trying to construct a function of type: liftSumthing :: ((a -> m b) -> m b) -> (a -> t m b) -> t m b where t is a monad transformer. Specifically, I\'m interested in doing this: liftSumthingIO :: MonadIO m => ((a -> IO b) -> IO b) -> (a -> m b) -> m b I fiddled with some Haskell wizardry libs and but to no avail. How do I get it right, or maybe there is a ready solution somewhere which I did not find? 回答1: This can't be done generically over all MonadIO instances because of the IO type