Created
April 8, 2011 15:59
-
-
Save voidlizard/910166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AppState where | |
import Happstack.Server.SimpleHTTP (ServerPartT) | |
import Control.Concurrent.MVar | |
import Control.Monad.Reader | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
import Db (Context) | |
type MyServerPartT = ServerPartT (ReaderT AppState IO) | |
type Permission = String | |
type Permissions = S.Set Permission | |
data SessionData = SessionData { login :: String | |
,permissions :: Permissions | |
} | |
type Sessions = M.Map String SessionData | |
data AppState = AppState { | |
dbCtx :: Context | |
,sessions :: MVar Sessions | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment