hosc-0.15: Haskell Open Sound Control

Safe Haskell | None
Language | Haskell98

Sound.OSC.Coding

Description

A type-class to provide coding operations to different data types using the same function names.

Synopsis

- class Coding a where
- type Coder = (Packet -> ByteString, ByteString -> Packet)
- encodeMessage :: Coding c => Message -> c
- encodeBundle :: Coding c => Bundle -> c
- decodeMessage :: Coding c => c -> Maybe Message
- decodeBundle :: Coding c => c -> Bundle

# Documentation

class Coding a where Source #

Converting from and to binary packet representations.

Minimal complete definition

encodePacket, decodePacket

Methods

encodePacket :: Packet -> a Source #

decodePacket :: a -> Packet Source #

Instances

Coding String Source # |
Methods encodePacket :: Packet -> String Source # decodePacket :: String -> Packet Source #
Coding ByteString Source # |
Methods encodePacket :: Packet -> ByteString Source # decodePacket :: ByteString -> Packet Source #
Coding ByteString Source # |
Methods encodePacket :: Packet -> ByteString Source # decodePacket :: ByteString -> Packet Source #

type Coder = (Packet -> ByteString, ByteString -> Packet) Source #

An `encodePacket` and `decodePacket` pair over `ByteString`.

encodeMessage :: Coding c => Message -> c Source #

`encodePacket` `.` `Packet_Message`.

encodeBundle :: Coding c => Bundle -> c Source #

`encodePacket` `.` `Packet_Bundle`.

decodeMessage :: Coding c => c -> Maybe Message Source #

`packet_to_message` `.` `decodePacket`.

decodeBundle :: Coding c => c -> Bundle Source #

`packet_to_bundle` `.` `decodePacket`.