Reviewed By: skcho Differential Revision: D20034813 fbshipit-source-id: 448909c20master
parent
e334647db8
commit
dcb3ab1288
@ -1,23 +0,0 @@
|
|||||||
(*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*)
|
|
||||||
|
|
||||||
open! IStd
|
|
||||||
|
|
||||||
type t = unit -> int
|
|
||||||
|
|
||||||
let make : int -> t =
|
|
||||||
fun init ->
|
|
||||||
let num_ref = ref init in
|
|
||||||
let get_num () =
|
|
||||||
let v = !num_ref in
|
|
||||||
num_ref := v + 1 ;
|
|
||||||
v
|
|
||||||
in
|
|
||||||
get_num
|
|
||||||
|
|
||||||
|
|
||||||
let next : t -> int = fun counter -> counter ()
|
|
@ -1,14 +0,0 @@
|
|||||||
(*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*)
|
|
||||||
|
|
||||||
open! IStd
|
|
||||||
|
|
||||||
type t
|
|
||||||
|
|
||||||
val make : int -> t
|
|
||||||
|
|
||||||
val next : t -> int
|
|
Loading…
Reference in new issue