Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Monad class implementing an Open Sound Control transport.
Synopsis
- class Monad m => SendOsc m where
- sendPacket :: PacketOf Message -> m ()
- class Monad m => RecvOsc m where
- recvPacket :: m (PacketOf Message)
- class (SendOsc m, RecvOsc m) => DuplexOsc m
- class (DuplexOsc m, MonadIO m) => Transport m
- type Connection t a = ReaderT t IO a
- withTransport :: Transport t => IO t -> Connection t r -> IO r
- withTransport_ :: Transport t => IO t -> Connection t r -> IO ()
- sendMessage :: SendOsc m => Message -> m ()
- sendBundle :: SendOsc m => BundleOf Message -> m ()
- recvBundle :: RecvOsc m => m (BundleOf Message)
- recvMessage :: RecvOsc m => m (Maybe Message)
- recvMessage_err :: RecvOsc m => m Message
- recvMessages :: RecvOsc m => m [Message]
- waitUntil :: RecvOsc m => (PacketOf Message -> Bool) -> m (PacketOf Message)
- waitFor :: RecvOsc m => (PacketOf Message -> Maybe a) -> m a
- waitImmediate :: RecvOsc m => m (PacketOf Message)
- waitMessage :: RecvOsc m => m Message
- waitAddress :: RecvOsc m => Address_Pattern -> m (PacketOf Message)
- waitReply :: RecvOsc m => Address_Pattern -> m Message
- waitDatum :: RecvOsc m => Address_Pattern -> m [Datum]
Documentation
class Monad m => SendOsc m where Source #
Sender monad.
sendPacket :: PacketOf Message -> m () Source #
Encode and send an Osc packet.
class Monad m => RecvOsc m where Source #
Receiver monad.
recvPacket :: m (PacketOf Message) Source #
Receive and decode an Osc packet.
type Connection t a = ReaderT t IO a Source #
Transport connection.
withTransport :: Transport t => IO t -> Connection t r -> IO r Source #
Bracket Open Sound Control communication.
withTransport_ :: Transport t => IO t -> Connection t r -> IO () Source #
void
of withTransport
.
Send
sendMessage :: SendOsc m => Message -> m () Source #
Type restricted synonym for sendOsc
.
Receive
recvBundle :: RecvOsc m => m (BundleOf Message) Source #
Variant of recvPacket
that runs packet_to_bundle
.
recvMessage :: RecvOsc m => m (Maybe Message) Source #
Variant of recvPacket
that runs packet_to_message
.
recvMessage_err :: RecvOsc m => m Message Source #
Erroring variant.
recvMessages :: RecvOsc m => m [Message] Source #
Variant of recvPacket
that runs packetMessages
.
Wait
waitUntil :: RecvOsc m => (PacketOf Message -> Bool) -> m (PacketOf Message) Source #
Wait for a Packet
where the supplied predicate is True
,
discarding intervening packets.
waitFor :: RecvOsc m => (PacketOf Message -> Maybe a) -> m a Source #
Wait for a Packet
where the supplied function does not give Nothing
,
discarding intervening packets.
waitMessage :: RecvOsc m => m Message Source #
waitFor
packet_to_message
,
ie. an incoming Message
or immediate mode Bundle
with one element.
waitAddress :: RecvOsc m => Address_Pattern -> m (PacketOf Message) Source #
A waitFor
for variant using packet_has_address
to match on
the Address_Pattern
of incoming Packets
.
waitReply :: RecvOsc m => Address_Pattern -> m Message Source #
Variant on waitAddress
that returns matching Message
.