Well, all IO actions can be made into Snap actions using liftIO. More informally, the IO monad is part of the Snap monad.
So you can use IORefs, MVars, or STM to persist stuff across requests. Take your pick! =) Best, Leon On Wed, Nov 10, 2010 at 10:29 AM, Ozgun Ataman <[email protected]> wrote: > Hey everyone, This is my first post to the Snap mailing list and I wanted to > thank everyone for the outstanding contribution to the community. Gregory > was kind enough last week to take the time to explain a few things to me > over IRC, and I've been finding myself increasingly eager to put Snap to use > and contribute back to the project wherever I can. Thinking about practical > applications, one question that immediately sprang to my mind was how a set > of custom configuration data – say in a custom made record – could be > persisted across Request-> Response cycles? As far as I can see, there is no > place in the Snap monad or anywhere else to do this. Some typical use cases > would be: * Database connection information * Open database handles, a pool > of connections, etc. * Various app parameters * One-time loaded large > mappings like i18n translation data (from YAML or .po files) to be used in > dynamically rendering the templates I suspect this may be a recurring need > and I was wondering how folks chose to tackle it. Thank you, Oz > _______________________________________________ > Snap mailing list > [email protected] > http://mailman-mail5.webfaction.com/listinfo/snap > > _______________________________________________ Snap mailing list [email protected] http://mailman-mail5.webfaction.com/listinfo/snap
