snapframework / snap

Top-level package for the official Snap Framework libraries, includes the snaplets API as well as infrastructure for sessions, auth, and templates.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
455 stars 68 forks source link

SessionManager is weird #99

Open mikeplus64 opened 10 years ago

mikeplus64 commented 10 years ago

Currently SessionManager is an existential type that wraps around something that has an instance of ISessionManager. But no instances of ISessionManager are actually exposed, despite the docs linking to a "CookieSession", so it's the existential is a slightly more inefficient way of writing

data SessionManager r = SessionManager
  { load :: r -> Snap r
  , commit :: r -> Snap ()
  , ...
  }

But that isn't very satisfying either.