zre-0.1.4.0: ZRE protocol implementation
Safe HaskellNone
LanguageHaskell2010

Network.ZRE.Chan

Synopsis

Documentation

zreChan :: forall input output inputGroup outputGroup. (Serialize input, Serialize output, KnownGroup inputGroup, KnownGroup outputGroup) => IO (TChan input, TChan output) Source #

Typed ZRE channel using two groups

  • input -> outputGroup for transfering encoded data
  • inputGroup -> output for receiving decoded data

Unexpected data on channel will result in error.

zreChan' :: (Serialize input, Serialize output) => Group -> Group -> IO (TChan input, TChan output) Source #

Like zreChan but with non-symbolic groups

zreChanWith :: (Serialize input, Serialize output) => (ZRE () -> IO ()) -> Group -> Group -> IO (TChan input, TChan output) Source #

Principled version accepting runner function

mapToGroup Source #

Arguments

:: forall fromGroup toGroup from to. (Serialize from, Show from, Serialize to, KnownGroup fromGroup, KnownGroup toGroup) 
=> (from -> to)

Conversion function

-> ZRE () 

Map function to deserialized data type received from one group and send it encoded to another group. Basically a typed proxy between two groups.

mapToGroup' Source #

Arguments

:: (Show from, Serialize from, Serialize to) 
=> Group

Group to listen to and decode its messages

-> Group

Group to send encoded messages to

-> (from -> to)

Conversion function

-> ZRE () 

Like mapToGroup but with non-symbolic groups