n2o-0.11.0: Abstract Protocol Loop
Copyright(c) Marat Khafizov 2018
LicenseBSD-3
Maintainerxafizoff@gmail.com
Stabilityexperimental
Portabilitynot portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.N2O.Types

Description

Basic types

Synopsis

Documentation

type Header = (ByteString, ByteString) Source #

An HTTP header

data Req Source #

An HTTP request

Constructors

Req 

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

data Result a Source #

Result of the message processing

Constructors

Reply a 
Ok 
Unknown 
Empty 

Instances

Instances details
Eq a => Eq (Result a) Source # 
Instance details

Defined in Network.N2O.Types

Methods

(==) :: Result a -> Result a -> Bool #

(/=) :: Result a -> Result a -> Bool #

Show a => Show (Result a) Source # 
Instance details

Defined in Network.N2O.Types

Methods

showsPrec :: Int -> Result a -> ShowS #

show :: Result a -> String #

showList :: [Result a] -> ShowS #

newtype Proto f a Source #

N2O protocol handler

Constructors

Proto 

Fields

data Event a Source #

Event data type

Constructors

Init 
Message a 
Terminate 

type State f a = IORef (Context f a) Source #

Local mutable state

type N2O f a = N2OT (State f a) IO Source #

N2OT over IO with N2OState as env

newtype N2OT state m a Source #

Reader monad transformer

Constructors

N2OT 

Fields

Instances

Instances details
Monad m => Monad (N2OT state m) Source # 
Instance details

Defined in Network.N2O.Types

Methods

(>>=) :: N2OT state m a -> (a -> N2OT state m b) -> N2OT state m b #

(>>) :: N2OT state m a -> N2OT state m b -> N2OT state m b #

return :: a -> N2OT state m a #

Functor m => Functor (N2OT state m) Source # 
Instance details

Defined in Network.N2O.Types

Methods

fmap :: (a -> b) -> N2OT state m a -> N2OT state m b #

(<$) :: a -> N2OT state m b -> N2OT state m a #

Applicative m => Applicative (N2OT state m) Source # 
Instance details

Defined in Network.N2O.Types

Methods

pure :: a -> N2OT state m a #

(<*>) :: N2OT state m (a -> b) -> N2OT state m a -> N2OT state m b #

liftA2 :: (a -> b -> c) -> N2OT state m a -> N2OT state m b -> N2OT state m c #

(*>) :: N2OT state m a -> N2OT state m b -> N2OT state m b #

(<*) :: N2OT state m a -> N2OT state m b -> N2OT state m a #