ribosome-host-0.9.9.9: Neovim plugin host for Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ribosome.Host.Class.Msgpack.Array

Description

Helper for encoding values to a heterogeneous MessagePack array.

Synopsis

Documentation

newtype Acc Source #

Constructors

Acc 

Fields

Instances

Instances details
Show Acc Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

showsPrec :: Int -> Acc -> ShowS #

show :: Acc -> String #

showList :: [Acc] -> ShowS #

Eq Acc Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

(==) :: Acc -> Acc -> Bool #

(/=) :: Acc -> Acc -> Bool #

MsgpackArray (Acc -> Object) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

(MsgpackEncode a, MsgpackArray (Acc -> b)) => MsgpackArray (Acc -> a -> b) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

msgpackArray :: Acc -> a -> b Source #

MsgpackArray (Acc -> [Object]) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

msgpackArray :: Acc -> [Object] Source #

class MsgpackArray a where Source #

This class provides a variadic method for encoding MessagePack arrays.

Methods

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

Instances details
MsgpackArray (Acc -> Object) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

(MsgpackEncode a, MsgpackArray (Acc -> b)) => MsgpackArray (Acc -> a -> b) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

msgpackArray :: Acc -> a -> b Source #

MsgpackArray (Acc -> [Object]) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

msgpackArray :: Acc -> [Object] Source #

MsgpackArray (a -> a) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

msgpackArray :: a -> a Source #

(MsgpackEncode a, MsgpackArray (Acc -> b)) => MsgpackArray (a -> b) Source # 
Instance details

Defined in Ribosome.Host.Class.Msgpack.Array

Methods

msgpackArray :: a -> b Source #