File: delayed.ml

package info (click to toggle)
pplacer 1.1~alpha19-8
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 17,324 kB
  • sloc: ml: 20,927; ansic: 9,002; python: 1,641; makefile: 171; sh: 77; xml: 50
file content (16 lines) | stat: -rw-r--r-- 224 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
open Ppatteries

type 'a t = 'a option ref

let create () = ref None

let init v = ref (Some v)

let of_option = ref

let reify v f = match !v with
  | Some v' -> v'
  | None ->
    let v' = f () in
    v := Some v';
    v'