getL :: Lens b (Snaplet MongoDBSnaplet) -> b -> Snaplet MongoDBSnaplet
The intuition is that "Lens record field" represents a getter and
setter for a field inside
of some record. "getL" gets the getter, and "setL" gets the setter.
When writing a snaplet, you don't know what this record looks like,
so this is why the record is
a polymorphic variable ("b", in this case.) And when writing a
snaplet, you can't know what the
record looks like, as it can change when you
add/remove/reconfigure/modify other snaplets that
make up your app. So from type of your function:
initMongoDBAuthManager
:: AuthSettings
-- ^ Authentication settings for your app
-> Lens b (Snaplet SessionManager)
-- ^ Lens into a 'SessionManager' auth snaplet will use
-> Lens b (Snaplet MongoDBSnaplet)
-- ^ Lens into a 'MongoDBSnaplet'
-> SnapletInit b (AuthManager b)
So when you are inside "initMongoDBAuthManager", the only things you
know about record "b" is that
it has a field of type (Snaplet SessionManager) and another field of
type (Snaplet MongoDBSnaplet), nothing
more and nothing less. Instead of referring to the fields via some
.dotname, you are passed the field names instead.
Best,
Leon