Monad for Fact Acquisition, Prediction and Optimization