I have a library of functions that all take cfg parameter (and usually others) and return results in the IO monad.<br><br>It is sometimes useful to drop the config parameter by using a state-like monad..<br><br>I have found that I can wrap all my functions like so:<br>
<br>withLibrary cfg f = f cfg<br><br>stateF a b c d =<br><br>