Client Side Sessions: I’ve provided a second implementation of sessions based entirely on cookies and Michael Snoyman’s clientsession package. This was in the cards from the beginning, but it’s not my favorite choice, so it was second in the list of implementations.

Module Reorganization: I moved some modules around, in acknowledgement that the dialogues programming model is not actually a Snap extension. Instead, it’s a library that builds on sessions.

Matching APIs with Ozataman’s Package: One of the bigger surprises was learning that ozataman is already working on a different sessions package for Snap. Because of substantial design differences, I will still continue to develop my implementation anyway; but at least we can keep the exposed APIs similar. As such, you’ll notice that MonadSession looks very similar between the two. The differences are:

Whereas ozataman defines the session type as a type alias at the top of the module, in my package it’s an associated type inside the MonadSession type class.

Whereas ozataman defines setInSession, deleteFromSession, and getFromSession as members of MonadSession with default implementations, I define them as convenience functions following the MonadSession type class, and with somewhat more general types.

Aside from that, Snap.Extension.Session is basically the same between the two. The implementations differ considerably.

Share this:

Like this:

Related

3 Comments

I noticed that snap requires network-2.3. That’s quite painful since you only get 2.2.1.7 +network-bytestring with Haskell Platform on Windows. Does it really need new network package? As far as I remember API is the same.