Turning A => M[B] into M[A => B]
For a monad M , Is it possible to turn A => M[B] into M[A => B] ? I've tried following the types to no avail, which makes me think it's not possible, but I thought I'd ask anyway. Also, searching Hoogle for a -> m b -> m (a -> b) didn't return anything, so I'm not holding out much luck. chi In Practice No, it can not be done, at least not in a meaningful way. Consider this Haskell code action :: Int -> IO String action n = print n >> getLine This takes n first, prints it (IO performed here), then reads a line from the user. Assume we had an hypothetical transform :: (a -> IO b) -> IO (a -> b)