Skip to content

Commit

Permalink
Added note about the (.) from Control.Category to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Pilař committed Jan 17, 2012
1 parent af9bcf1 commit 54d6c75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -35,7 +35,7 @@ We will follow the common Snap project structure.
import Snap.Snaplet.MongoDB.Core

import Control.Category
import Prelude hiding ((.))
import Prelude hiding ((.)) -- The (.) is used in getMongoDB definition.

data App = App
{ _heist :: Snaplet (Heist App)
Expand Down
2 changes: 2 additions & 0 deletions src/Snap/Snaplet/MongoDB/Core.hs
Expand Up @@ -29,6 +29,8 @@ data MongoDB = MongoDB
-- instance HasMongoDB App where
-- getMongoDB = getL (snapletValue . database)
-- @
--
-- Note: The (.) is from Control.Category.
class HasMongoDB app where
getMongoDB :: app -> MongoDB

3 changes: 2 additions & 1 deletion src/Snap/Snaplet/MongoDB/Functions.hs
Expand Up @@ -37,8 +37,9 @@ description = "Minimalistic MongoDB Snaplet."
-- @
-- app :: SnapletInit App App
-- app = makeSnaplet "app" "An snaplet example application." Nothing $ do
-- h <- nestSnaplet "heist" heist $ heistInit "resources/templates"
-- d <- nestSnaplet "database" database $ mongoDBInit 10 (host "127.0.0.1") "Snaplet-MongoDB"
-- return $ App d
-- return $ App h d
-- @
mongoDBInit :: Int -> Host -> Database -> SnapletInit app MongoDB
mongoDBInit n h d = makeSnaplet "snaplet-mongodb" description Nothing $ do
Expand Down

0 comments on commit 54d6c75

Please sign in to comment.