package prbnmcn-basic-structures

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module type Lang.EnumSource

Abstraction for enums.

type 'a m
type t

The type of enumerations.

val all : t array

All cases in the enumeration.

val enum : t -> int

enum x is the index of x in all.

val const : t -> t m

Injects a case of the enumeration from the meta to the object language.

val dispatch : t m -> (t -> 'a m) -> 'a m

Dispatch on a value of the enumeration.