Skip to content

Instantly share code, notes, and snippets.

@susisu
Created July 25, 2018 15:34
Show Gist options
  • Save susisu/1b8ca93b934925d0ecb672f7f567dd39 to your computer and use it in GitHub Desktop.
Save susisu/1b8ca93b934925d0ecb672f7f567dd39 to your computer and use it in GitHub Desktop.
module Iterator: sig
type 'a t
type 'a result =
| Done
| Continue of 'a
val next: 'a t -> 'a result
end
module type Iterable = sig
type t
type value
val iterator: t -> value Iterator.t
end
module Make (I: Iterable): sig
val iterate: I.t -> f:(I.value -> unit) -> unit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment