| Copyright | (c) Marat Khafizov 2018 |
|---|---|
| License | BSD-3 |
| Maintainer | xafizoff@gmail.com |
| Stability | experimental |
| Portability | not portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Network.N2O.Types
Description
Basic types
Synopsis
- type Header = (ByteString, ByteString)
- data Req = Req {
- reqPath :: ByteString
- reqMeth :: ByteString
- reqVers :: ByteString
- reqHead :: [Header]
- data Context (f :: * -> *) a = Context {
- cxHandler :: Event a -> N2O f a (Result a)
- cxReq :: Req
- cxMiddleware :: [Context f a -> Context f a]
- cxProtos :: [Proto f a]
- cxDePickle :: ByteString -> Maybe a
- cxPickle :: a -> ByteString
- cxState :: Map ByteString ByteString
- data Result a
- newtype Proto f a = Proto {}
- data Event a
- type State f a = IORef (Context f a)
- type N2O f a = N2OT (State f a) IO
- newtype N2OT state m a = N2OT {
- runN2O :: state -> m a
Documentation
type Header = (ByteString, ByteString) Source #
An HTTP header
An HTTP request
Constructors
| Req | |
Fields
| |
data Context (f :: * -> *) a Source #
The N2O context data type
This is the key data type of the N2O. (f :: * -> *) - type constructor
for the protocol handler's input type. (a :: *) - base type for the
event handler's input type. I.e. (f a) gives input type for the
protocol handler. (Event a) gives input type for the event handler.
Constructors
| Context | |
Fields
| |
Result of the message processing
N2O protocol handler
newtype N2OT state m a Source #
Reader monad transformer
Instances
| Monad m => Monad (N2OT state m) Source # | |
| Functor m => Functor (N2OT state m) Source # | |
| Applicative m => Applicative (N2OT state m) Source # | |
Defined in Network.N2O.Types | |