package streamable

  1. Overview
  2. Docs
A collection of types suitable for incremental serialization.

Install

Dune Dependency

Authors

Maintainers

Sources

streamable-v0.16.0.tar.gz
sha256=619eb20eec02100eb0a49ab7b0c63b083c89e81a326b16851dfa1c5aa906b0a8

doc/src/ppx_streamable/module_dot_t_clause.ml.html

Source file module_dot_t_clause.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open! Base
open! Import

let maybe_match type_ (_ : Ctx.t) =
  let%bind core_type   = Type.match_core_type type_ in
  let%map  module_name = Helpers.if_module_dot_t_then_module core_type
  and () =
    match core_type.ptyp_desc with
    | Ptyp_constr (_, []) -> Some ()
    | _ -> None
  in
  ({ children      = []
   ; apply_functor =
       (fun { loc; _ } children ->
          assert (List.is_empty children);
          pmod_ident ~loc module_name)
   }
   : Clause.Match.t)
;;
OCaml

Innovation. Community. Security.