Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Helper for encoding values to a heterogeneous MessagePack array.
Synopsis
- newtype Acc = Acc {}
- class MsgpackArray a where
- msgpackArray :: a
Documentation
Instances
Show Acc Source # | |
Eq Acc Source # | |
MsgpackArray (Acc -> Object) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: Acc -> Object Source # | |
(MsgpackEncode a, MsgpackArray (Acc -> b)) => MsgpackArray (Acc -> a -> b) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: Acc -> a -> b Source # | |
MsgpackArray (Acc -> [Object]) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: Acc -> [Object] Source # |
class MsgpackArray a where Source #
This class provides a variadic method for encoding MessagePack arrays.
msgpackArray :: a Source #
Encode an arbitrary number of heterogeneously typed values to a single MessagePack array. This function is variadic, meaning that it takes an arbitrary number of arguments:
>>>
msgpackArray (5 :: Int) ("error" :: Text) (3.14 :: Double) :: Object
ObjectArray [ObjectInt 5, ObjectString "error", ObjectFloat 3.14]
This avoids the need to call toMsgpack
once for each element and then once more for the array.
Instances
MsgpackArray (Acc -> Object) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: Acc -> Object Source # | |
(MsgpackEncode a, MsgpackArray (Acc -> b)) => MsgpackArray (Acc -> a -> b) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: Acc -> a -> b Source # | |
MsgpackArray (Acc -> [Object]) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: Acc -> [Object] Source # | |
MsgpackArray (a -> a) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: a -> a Source # | |
(MsgpackEncode a, MsgpackArray (Acc -> b)) => MsgpackArray (a -> b) Source # | |
Defined in Ribosome.Host.Class.Msgpack.Array msgpackArray :: a -> b Source # |