polysemy-socket-0.0.2.0: Socket effect for polysemy.
LicenseMIT
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Polysemy.Socket

Description

Socket effect for polysemy.

Synopsis

Definition

data Socket s k b c m a where Source #

Since: 0.0.1.0

Constructors

Acquire :: Socket s k b c m s 
Bind :: s -> Socket s k b c m () 
Release :: s -> Socket s k b c m () 
Listen :: s -> Int -> Socket s k b c m () 
Accept :: s -> Socket s k b c m (s, k) 
Send :: s -> c -> Socket s k b c m () 
Receive :: s -> Socket s k b c m b 
Close :: s -> Socket s k b c m () 

acquire :: forall s k b c r. MemberWithError (Socket s k b c) r => Sem r s Source #

bind :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r () Source #

listen :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Int -> Sem r () Source #

send :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> c -> Sem r () Source #

receive :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r b Source #

release :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r () Source #

accept :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r (s, k) Source #

close :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r () Source #

Adapters

adaptSocket :: Members '[Socket s k b' c'] r => (b' -> b) -> (c -> c') -> Sem (Socket s k b c ': r) a -> Sem r a Source #

Since: 0.0.1.0

adaptSocketSem :: forall s k b c b' c' r a. Members '[Socket s k b' c'] r => (b' -> Sem r b) -> (c -> Sem r c') -> Sem (Socket s k b c ': r) a -> Sem r a Source #

Since: 0.0.1.0

Eliminators

runSocketTcp :: forall s r a. (Socket Inet6 Stream TCP ~ s, Members '[Resource, Embed IO, Input Inet6Port] r) => Sem (Socket s (SocketAddress Inet6) ByteString ByteString ': r) a -> Sem r a Source #

Since: 0.0.1.0

runSocketVirtual :: Members '[State p] r => (c -> p) -> (p -> b) -> Sem (Socket Virtual Virtual b c ': r) a -> Sem r a Source #

Since: 0.0.1.0

Tracing

traceSocket :: forall s k b c r a. Members '[Socket s k b c, Trace] r => Sem r a -> Sem r a Source #

Since: 0.0.1.0