From b7a063e1ee41e6252c3d0fac9c3e47ae8ef9aa0c Mon Sep 17 00:00:00 2001 From: Felipe Lessa Date: Wed, 27 May 2015 16:18:54 -0300 Subject: [PATCH] Add useful instances to some core structures. --- serversession/src/Web/ServerSession/Core/Internal.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/serversession/src/Web/ServerSession/Core/Internal.hs b/serversession/src/Web/ServerSession/Core/Internal.hs index e47d681..5afbff6 100644 --- a/serversession/src/Web/ServerSession/Core/Internal.hs +++ b/serversession/src/Web/ServerSession/Core/Internal.hs @@ -30,7 +30,7 @@ module Web.ServerSession.Core.Internal , saveSession , SaveSessionToken(..) , invalidateIfNeeded - , DecomposedSession + , DecomposedSession(..) , decomposeSession , saveSessionOnDb , toSessionMap @@ -383,7 +383,9 @@ cookieExpires state session = -- | Opaque token containing the necessary information for -- 'saveSession' to save the session. -data SaveSessionToken = SaveSessionToken (Maybe Session) UTCTime +data SaveSessionToken = + SaveSessionToken (Maybe Session) UTCTime + deriving (Eq, Show, Typeable) -- | Save the session on the storage backend. A @@ -430,7 +432,7 @@ data DecomposedSession = { dsAuthId :: !(Maybe ByteString) , dsForceInvalidate :: !ForceInvalidate , dsSessionMap :: !SessionMap - } deriving (Show, Typeable) + } deriving (Eq, Show, Typeable) -- | Decompose a session (see 'DecomposedSession'). @@ -524,4 +526,4 @@ data ForceInvalidate = | DoNotForceInvalidate -- ^ Do not force invalidate. Invalidate only if -- automatically. This is the default. - deriving (Eq, Ord, Show, Read, Enum, Typeable) + deriving (Eq, Ord, Show, Read, Bounded, Enum, Typeable)