package spotlib

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

Source file once.ml

1
2
3
4
5
6
7
8
9
10
11
12
type 'a t = 'a option ref

let create () = ref None

exception Already_initialized

let set x v = match x with
  | {contents = Some _} -> raise Already_initialized
  | r -> r := Some v

let get x = !x

OCaml

Innovation. Community. Security.