toxcore-0.2.11: A Tox protocol implementation in Haskell
Safe HaskellTrustworthy
LanguageHaskell2010

Network.Tox.Network.Networked

Description

Abstraction layer for network functionality.

The intention is to (i) separate the logic of the protocol from its binary encoding, and (ii) allow a simulated network in place of actual network IO.

Synopsis

Documentation

class Monad m => Networked m where Source #

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> m () Source #

Instances

Instances details
Monad m => Networked (NetworkLogged m) Source #

just log network events

Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> NetworkLogged m () Source #

Networked m => Networked (KeyedT m) Source # 
Instance details

Defined in Network.Tox.Crypto.KeyedT

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> KeyedT m () Source #

Networked m => Networked (TimedT m) Source # 
Instance details

Defined in Network.Tox.TimedT

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> TimedT m () Source #

Networked m => Networked (RandT s m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> RandT s m () Source #

Networked m => Networked (StateT s m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> StateT s m () Source #

Networked (StateT NetworkState IO) Source #

actual network IO

Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> StateT NetworkState IO () Source #

Networked m => Networked (ReaderT r m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> ReaderT r m () Source #

(Monoid w, Networked m) => Networked (WriterT w m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> WriterT w m () Source #

type NetworkState = () Source #

TODO: sockets etc

newtype NetworkLogged m a Source #

Constructors

NetworkLogged (WriterT [NetworkEvent] m a) 

Instances

Instances details
DhtNodeMonad TestDhtNodeMonad Source # 
Instance details

Defined in Network.Tox.DHT.Operation

MonadState s m => MonadState s (NetworkLogged m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

get :: NetworkLogged m s #

put :: s -> NetworkLogged m () #

state :: (s -> (a, s)) -> NetworkLogged m a #

Monad m => Monad (NetworkLogged m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

(>>=) :: NetworkLogged m a -> (a -> NetworkLogged m b) -> NetworkLogged m b #

(>>) :: NetworkLogged m a -> NetworkLogged m b -> NetworkLogged m b #

return :: a -> NetworkLogged m a #

Functor m => Functor (NetworkLogged m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

fmap :: (a -> b) -> NetworkLogged m a -> NetworkLogged m b #

(<$) :: a -> NetworkLogged m b -> NetworkLogged m a #

Applicative m => Applicative (NetworkLogged m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Methods

pure :: a -> NetworkLogged m a #

(<*>) :: NetworkLogged m (a -> b) -> NetworkLogged m a -> NetworkLogged m b #

liftA2 :: (a -> b -> c) -> NetworkLogged m a -> NetworkLogged m b -> NetworkLogged m c #

(*>) :: NetworkLogged m a -> NetworkLogged m b -> NetworkLogged m b #

(<*) :: NetworkLogged m a -> NetworkLogged m b -> NetworkLogged m a #

MonadRandomBytes m => MonadRandomBytes (NetworkLogged m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Timed m => Timed (NetworkLogged m) Source # 
Instance details

Defined in Network.Tox.Network.Networked

Monad m => Networked (NetworkLogged m) Source #

just log network events

Instance details

Defined in Network.Tox.Network.Networked

Methods

sendPacket :: (Binary payload, Show payload) => NodeInfo -> Packet payload -> NetworkLogged m () Source #