Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Datum
related functions.
- datum_int32 :: Datum -> Maybe Int32
- datum_int64 :: Datum -> Maybe Int64
- datum_float :: Datum -> Maybe Float
- datum_double :: Datum -> Maybe Double
- datum_ascii :: Datum -> Maybe ASCII
- datum_string :: Datum -> Maybe String
- datum_blob :: Datum -> Maybe ByteString
- datum_timestamp :: Datum -> Maybe Time
- datum_midi :: Datum -> Maybe MIDI
- datum_sequence :: Datum -> Maybe [Word8]
Documentation
datum_int32 :: Datum -> Maybe Int32 Source
Type specialised d_get
.
map datum_int32 [Int32 1,Float 1] == [Just 1,Nothing]
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
datum_blob :: Datum -> Maybe ByteString Source
Type specialised d_get
.
datum_timestamp :: Datum -> Maybe Time Source
Maybe
variant of d_timestamp
.
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]]