package ppx_deriving_rpc

  1. Overview
  2. Docs

Module Ppx_deriving_rpcty.Typ_ofSource

Sourceval expr_of_typ : loc:Ppxlib.location -> Ppxlib.core_type -> Ppxlib_ast.Ast.expression

expr_of_typ ~loc typ returns an expression of type `Rpc.Types.typ` that represents the core_type typ`.

Sourcetype field_def = {
  1. f_name : string;
  2. rpc_name : string;
  3. value_name : string;
  4. expr : Ppxlib.expression;
  5. default : Ppxlib.expression option;
  6. typ : Ppxlib.expression;
}
Sourceval str_of_type : Ppxlib__.Location.t -> Ppxlib.type_declaration -> Ppxlib__.Import.value_binding list

str_of_type loc type_decl returns a list of value bindings that are values of type `Rpc.Types.def` and `Rpc.Types.typ` that represent the newly defined type.