Spec-Zone.ru › OCaml
☰The OCaml language
  • The OCaml language
  • Language extensions

Chapter 12 Language extensions

20 Empty variant types

(Introduced in 4.07.0)

type-representation ::= ...
∣ = |

This extension allows user to define empty variants. Empty variant type can be eliminated by refutation case of pattern matching.

type t = |
let f (x: t) = match x with _ -> .
« Extended indexing operatorsAlerts »
Copyright © 2026 Institut National de Recherche en Informatique et en Automatique

© 1995-2026 INRIA.
https://ocaml.org/manual/5.5/emptyvariants.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API