I've just written this function which simply takes a pair whose second value is in some monad, and "pulls the monad out" to cover the whole pair.
unSndM :: Monad m => (a, m c) -> m (a, c)
unSndM (x, y) = do y' <- y
return (x, y')
Is there a nicer and/or shorter or point-free or even standard way to express this?
I've got as far as the following, with -XTupleSections turned on...
unSndM' :: Monad m => (a, m c) -> m (a, c)
unSndM' (x, y) = y >>= return . (x,)
Thanks!