The Network.N2O.Internal module contains request and context definition, state and N2O monad.
type Header = (BS.ByteString, BS.ByteString) data Req = Req { reqPath :: BS.ByteString , reqMeth :: BS.ByteString , reqVers :: BS.ByteString , reqHead :: [Header] }
data Resp = Resp { respCode :: Int , respHead :: [Header] , respBody :: BS.ByteString } deriving (Show)
data Event a = Init | Message a | Terminate deriving Show
data Result a = Reply a | Ok | Unknown | Empty deriving (Show, Eq)
data Context (f :: * -> *) a where Context :: { cxHandler :: Event a -> N2O f a (Result a) , cxReq :: Req , cxMiddleware :: [Context f a -> Context f a] , cxProtos :: [Proto f a] , cxActions :: BS.ByteString , cxDict :: M.Map BS.ByteString BS.ByteString } -> Context f a
mkCx = Context { cxReq = undefined , cxHandler = undefined , cxMiddleware = [] , cxProtos = [] , cxActions = "" , cxDict = M.empty }
type Proto (f :: * -> *) a = (f a) -> N2O f a (Result (f a)) type N2O f a = ReaderT (IORef (Context f a)) IO
This module may refer to: INT, CORE