Let's say we have a monadic sequence:
doSomething = do
a <- f
b <- g
c <- h
pure (a, b, c)
We can easily rewrite it using applicative functor:
doSomething2 = (,,) <$> f <*> g <*> h
But what if the monadic sequence looks like this:
doSomething' n = do
a <- f n
b <- g a
c <- h b
pure (a, b, c)
Is it still possible to use applicative there? If not, what is the hindrance?
(Also it is written in a book that, despite this, we can use applicative and join together, but I don't see how to).