- data MongoDB = MongoDB {}
- class HasMongoDB app where
- getMongoDB :: app -> MongoDB
Documentation
Snaplet's data type.
Example:
data App = App
{ _heist :: Snaplet (Heist App)
, _database :: Snaplet MongoDB
}
class HasMongoDB app whereSource
Snaplet's type-class.
Example:
instance HasMongoDB App where
getMongoDB = getL (snapletValue . database)
Note: The (.) is from Control.Category.
getMongoDB :: app -> MongoDBSource