| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Ribosome.Host.Class.Msgpack.Util
Description
Utilities for writing messagepack codec instances.
Synopsis
- pattern MsgpackString :: String -> Object
- byteStringField :: Typeable a => (ByteString -> Either FieldError a) -> Object -> Either FieldError a
- stringField :: Typeable a => IsString a => Object -> Either FieldError a
- decodeString :: Typeable a => IsString a => Object -> Either DecodeError a
- decodeByteString :: Typeable a => (ByteString -> Either FieldError a) -> Object -> Either DecodeError a
- decodeUtf8Lenient :: Typeable a => ConvertUtf8 a ByteString => Object -> Either DecodeError a
- readField :: forall a. Read a => Typeable a => String -> Either FieldError a
- integralField :: forall a. Read a => Integral a => Typeable a => Object -> Either FieldError a
- decodeIntegral :: forall a. Read a => Integral a => Typeable a => Object -> Either DecodeError a
- fractionalField :: Read a => Typeable a => Fractional a => Object -> Either FieldError a
- decodeFractional :: forall a. Read a => Fractional a => Typeable a => Object -> Either DecodeError a
Documentation
byteStringField :: Typeable a => (ByteString -> Either FieldError a) -> Object -> Either FieldError a Source #
Call the continuation if the Object contains a ByteString, or an error otherwise.
stringField :: Typeable a => IsString a => Object -> Either FieldError a Source #
Decode a ByteString field using IsString.
decodeString :: Typeable a => IsString a => Object -> Either DecodeError a Source #
Decode a ByteString type using IsString.
decodeByteString :: Typeable a => (ByteString -> Either FieldError a) -> Object -> Either DecodeError a Source #
Decode a ByteString type using IsString.
decodeUtf8Lenient :: Typeable a => ConvertUtf8 a ByteString => Object -> Either DecodeError a Source #
Decode a ByteString type using ConvertUtf8.
readField :: forall a. Read a => Typeable a => String -> Either FieldError a Source #
Decode a ByteString field using Read.
integralField :: forall a. Read a => Integral a => Typeable a => Object -> Either FieldError a Source #
decodeIntegral :: forall a. Read a => Integral a => Typeable a => Object -> Either DecodeError a Source #
fractionalField :: Read a => Typeable a => Fractional a => Object -> Either FieldError a Source #
Decode a numeric or string field using Fractional or Read.
decodeFractional :: forall a. Read a => Fractional a => Typeable a => Object -> Either DecodeError a Source #
Decode a numeric or string type using Fractional or Read.