package streamable

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

Install

Dune Dependency

Authors

Maintainers

Sources

v0.16.1.tar.gz
md5=c410b847f5a0f0be3c67b3403af04282
sha512=62cdeea4d38110bc6bd318e564e8277355928156c947400ee3e023998b60009a9d20073e8f7efedbe3bbada739bea56c6ff7d1eaba26898f6675ab690f03aadb

doc/src/ppx_streamable/type_.ml.html

Source file type_.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
open! Base
open! Import

type t =
  | Type_declaration of type_declaration
  | Core_type        of core_type
[@@deriving variants]

let loc = function
  | Type_declaration type_dec -> type_dec.ptype_loc
  | Core_type core_type       -> core_type.ptyp_loc
;;

let human_readable_name = function
  | Type_declaration type_dec ->
    (match type_dec.ptype_manifest with
     | Some core_type -> string_of_core_type core_type
     | None           -> type_dec.ptype_name.txt)
  | Core_type core_type -> string_of_core_type core_type
;;

let match_core_type = function
  | Type_declaration type_dec -> type_dec.ptype_manifest
  | Core_type core_type       -> Some core_type
;;
OCaml

Innovation. Community. Security.