License | MIT |
---|---|
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Socket effect for polysemy.
Synopsis
- data Socket s k b c m a where
- acquire :: forall s k b c r. MemberWithError (Socket s k b c) r => Sem r s
- bind :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r ()
- listen :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Int -> Sem r ()
- send :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> c -> Sem r ()
- receive :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r b
- release :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r ()
- accept :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r (s, k)
- close :: forall s k b c r. MemberWithError (Socket s k b c) r => s -> Sem r ()
- adaptSocket :: Members '[Socket s k b' c'] r => (b' -> b) -> (c -> c') -> Sem (Socket s k b c ': r) a -> Sem r a
- 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
- 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
- runSocketVirtual :: Members '[State p] r => (c -> p) -> (p -> b) -> Sem (Socket Virtual Virtual b c ': r) a -> Sem r a
- data Virtual
- traceSocket :: forall s k b c r a. Members '[Socket s k b c, Trace] r => Sem r a -> Sem r a
Definition
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