hosc-0.15: Haskell Open Sound Control

Safe HaskellSafe-Inferred
LanguageHaskell98

Sound.OSC.Datum

Description

Datum related functions.

Synopsis

Documentation

datum_int32 :: Datum -> Maybe Int32 Source

Type specialised d_get.

map datum_int32 [Int32 1,Float 1] == [Just 1,Nothing]

datum_int64 :: Datum -> Maybe Int64 Source

Type specialised d_get.

datum_float :: Datum -> Maybe Float Source

Type specialised d_get.

datum_double :: Datum -> Maybe Double Source

Type specialised d_get.

datum_ascii :: Datum -> Maybe ASCII Source

Type specialised d_get.

datum_ascii (d_put (C.pack "string")) == Just (C.pack "string")

datum_string :: Datum -> Maybe String Source

unpack of d_get.

datum_string (d_put (C.pack "string")) == Just "string"
map datum_string [string "string",Int32 5] == [Just "string",Nothing]

datum_blob :: Datum -> Maybe ByteString Source

Type specialised d_get.

datum_midi :: Datum -> Maybe MIDI Source

Type specialised d_get.

datum_sequence :: Datum -> Maybe [Word8] Source

Datum as sequence of Word8 if ASCII_String, Blob or Midi.

let d = [string "5",Blob (B.pack [53]),midi (0x00,0x90,0x40,0x60)]
in Data.Maybe.mapMaybe datum_sequence d == [[53],[53],[0,144,64,96]]