Update to Snap sessions package
I’ve been working furiously this weekend on the mysnapsession package that I announced a few days ago. Version 0.3 is now released.
I’ve started an introduction to the package, with a getting started step by step process, links to online API documentation, etc.
A few highlights of this new release:
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.