package data-encoding

  1. Overview
  2. Docs
type _ t

An encapsulation of consecutive encoding versions.

val first_version : 'a encoding -> 'a t

first_version enc records that enc is the first (known) version of the object.

val next_version : 'a encoding -> ('b -> 'a) -> 'b t -> 'a t

next_version enc upgrade prev constructs a new version from the previous version prev and an upgrade function.

val encoding : name:string -> 'a t -> 'a encoding

Make an encoding from an encapsulation of versions; the argument ~name is used to prefix the version "tag" in the encoding, it should not change from one version to the next.