hosc-0.21: Haskell Open Sound Control
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Osc.Transport.Monad

Description

Monad class implementing an Open Sound Control transport.

Synopsis

Documentation

class Monad m => SendOsc m where Source #

Sender monad.

Methods

sendPacket :: PacketOf Message -> m () Source #

Encode and send an Osc packet.

Instances

Instances details
(Transport t, MonadIO io) => SendOsc (ReaderT t io) Source #

SendOsc over ReaderT.

Instance details

Defined in Sound.Osc.Transport.Monad

Methods

sendPacket :: PacketOf Message -> ReaderT t io () Source #

class Monad m => RecvOsc m where Source #

Receiver monad.

Methods

recvPacket :: m (PacketOf Message) Source #

Receive and decode an Osc packet.

Instances

Instances details
(Transport t, MonadIO io) => RecvOsc (ReaderT t io) Source #

RecvOsc over ReaderT.

Instance details

Defined in Sound.Osc.Transport.Monad

class (SendOsc m, RecvOsc m) => DuplexOsc m Source #

DuplexOsc is the union of SendOsc and RecvOsc.

Instances

Instances details
(Transport t, MonadIO io) => DuplexOsc (ReaderT t io) Source #

DuplexOsc over ReaderT.

Instance details

Defined in Sound.Osc.Transport.Monad

class (DuplexOsc m, MonadIO m) => Transport m Source #

Transport is DuplexOsc with a MonadIO constraint.

Instances

Instances details
(Transport t, MonadIO io) => Transport (ReaderT t io) Source #

Transport over ReaderT.

Instance details

Defined in Sound.Osc.Transport.Monad

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.

Send

sendMessage :: SendOsc m => Message -> m () Source #

Type restricted synonym for sendOsc.

sendBundle :: SendOsc m => BundleOf 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.

waitImmediate :: RecvOsc m => m (PacketOf Message) Source #

waitUntil packet_is_immediate.

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.

waitDatum :: RecvOsc m => Address_Pattern -> m [Datum] Source #

Variant of waitReply that runs messageDatum.