Interesting. What sort of kv
s are you using this with? I don’t think I’ve come across the need for this pattern.
If I was using this I’d probably try to write it as an operator on m
actions rather than as a higher order function, for example, as
squeezeDry :: Applicative m => m a -> m (m a)
squeezeDry = fmap pure
Then I’d use it as squeezeDry m >>= kv
.