package orec

  1. Overview
  2. Docs

Type level data

type mut =
  1. | Nil_mutable

Type brand for getter field

type imm =
  1. | Nil_immutable
type ('core_type, 'brand) getter =
  1. | Nil_getter

Phantom type info carrier for updater and getter

type +'kind updater =
  1. | Nil_updater
type top =
  1. | Nil_top

Phantom type brand for const updater ( field ^= const ), function updater field |= f (field value) and delete updater

type only =
  1. | Nil_bottom
type 'a fn = top * 'a * 'a
type 'a const = 'a * top * 'a
type 'a del = 'a * 'a * top
type any = top * top * top

A type 'a fn|const|del can be unified to any or only fn|const|del, whereas a type only fn|const|del is fixed

type ('ty, 'fy, 'brand) storage =
  1. | Imm : ('a, 'a, imm) storage
  2. | Mut : ('a, 'a Stdlib.ref, mut) storage

Storage type-level function

type ('ty_arg, 'ty_res) access =
  1. | Opt : ('a, 'a option) access
  2. | Exn : ('a, 'a) access

Failure handling phantom type : either exception or option