Search code examples
haskellhaskell-snap-framework

snap snaplets : benefits of warpping a DB package in a snaplet


I want to run a web API with snap and I am going to use mongoDB. The hackage provides a well designed package named The mongoDB package. What benefits will I get if I use mongoDB package wrapped in a snaplet as opposed to use it alone.


Solution

  • The advantage is kind of the same as with using any other library--roughly that you won't have to write the code that the package author put in the package. I haven't looked at the mongodb snaplets in years, but this will probably be some code to read config data from the config file, set up the DB connections, etc.