package babel

  1. Overview
  2. Docs

High level functions for working with callees in the style of Async.Rpc.Rpc.implement'.

type ('q, 'r) implementation := 'q -> 'r
val singleton : ('q, 'r) Async_rpc_kernel.Rpc.Rpc.t -> ('q, 'r) implementation t

Create a callee which can implement a given rpc.

val add : ('q, 'r) implementation t -> rpc:('q, 'r) Async_rpc_kernel.Rpc.Rpc.t -> ('q, 'r) implementation t

Extend a callee to be able to implement a given rpc.

val map_query : ('q1, 'r) implementation t -> f:('q1 -> 'q2) -> ('q2, 'r) implementation t

Map over the query type of a callee.

val map_response : ('q, 'r1) implementation t -> f:('r2 -> 'r1) -> ('q, 'r2) implementation t

Map over the response type of a callee.

OCaml

Innovation. Community. Security.