How to handle side effect with Applicative?
问题 I see everywhere that Applicative can handle side effects, but all the simple examples I've seen are just combining stuff together like: > (,,) <$> [1,2] <*> ["a", "b", "c"] <*> ["foo", "bar"] [(1,"a","foo"),(1,"a","bar"),(1,"b","foo"),(1,"b","bar"), (1,"c","foo"),(1,"c","bar"),(2,"a","foo"),(2,"a","bar"), (2,"b","foo"),(2,"b","bar"),(2,"c","foo"),(2,"c","bar")] Which is cool but I can't see how that links to side effects. My understanding is that Applicative is a weak monad and so you can