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

Ribosome.Host.Handler.Codec

Description

Classes for converting functions to RPC handlers that may have special parameters.

Synopsis

Documentation

class HandlerArg a r where Source #

This class is used by HandlerCodec to decode handler function parameters. Each parameter may consume zero or arbitrarily many of the RPC message's arguments.

Users may create instances for their types to implement custom decoding, especially for commands, since those don't have structured arguments.

See also CommandHandler.

Methods

handlerArg :: [Object] -> Sem r ([Object], a) Source #

Instances

Instances details
Member (Stop Report) r => HandlerArg ArgList r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], ArgList) Source #

Member (Stop Report) r => HandlerArg Args r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], Args) Source #

Member (Stop Report) r => HandlerArg Bang r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], Bang) Source #

HandlerArg Bar r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], Bar) Source #

(Member (Stop Report) r, MsgpackDecode a) => HandlerArg a r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], a) Source #

(Member (Stop Report) r, FromJSON a) => HandlerArg (JsonArgs a) r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], JsonArgs a) Source #

(Member (Stop Report) r, OptionParser a) => HandlerArg (Options a) r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], Options a) Source #

HandlerArg a r => HandlerArg (Maybe a) r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerArg :: [Object] -> Sem r ([Object], Maybe a) Source #

class HandlerCodec h r | h -> r where Source #

The class of functions that can be converted to canonical RPC handlers of type RpcHandlerFun.

Methods

handlerCodec :: h -> RpcHandlerFun r Source #

Convert a type containing a Sem to a canonicalized RpcHandlerFun by transforming each function parameter with HandlerArg.

Instances

Instances details
MsgpackEncode a => HandlerCodec (Handler r a) r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

(HandlerArg a (Stop Report ': r), HandlerCodec b r) => HandlerCodec (a -> b) r Source # 
Instance details

Defined in Ribosome.Host.Handler.Codec

Methods

handlerCodec :: (a -> b) -> RpcHandlerFun r Source #