I've been digging into Haskell for the past months, I've run into a situation with monads that I am not quite sure how to handle.
I have one value of type a -> m a
and a second of type m (a -> a)
and I need to compose them such that the result of the first ends up as the input into the of the second and produces a m (a -> a)
if possible. I've been stuck on this for the past day now and I'm not wrapping my head around it. I suppose that I am looking for a function like (a -> m a) -> m (a -> a) -> m (a -> a)
. I can provide a more concrete example if it makes more sense.