Safe Haskell | Safe-Infered |
---|
Use Text
to send and receive messages.
For this module, a message is a single line;
the newline character acts as the end-of-message flag.
Receiving
Sending
(!) :: (CanSend h, MonadIO io) => h -> Text -> io ()Source
The staple for sending a message.
!
is typeclassed so that you can
send
or broadcast
using the same simple syntax.
The CanSend
typeclass is not exposed.
Instances of CanSend include Handle
and Traversable t => t Handle
.
!
produces an IO
action lifted into any MonadIO
,
so can be used without the extra cruft of liftIO
for most monad stacks. !
is declared as infix 2
.
Usage:
destination ! someText