From 6558a4f663745b86fa25469fe924c4b6697a7256 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 15 Nov 2023 23:15:53 -0500 Subject: [PATCH] Update iter doc to 1.7-8-g4f47de6. --- doc/index.html | 4 ++-- doc/iter/Iter/.dummy | 0 doc/iter/Iter/IO/index.html | 2 +- doc/iter/Iter/Infix/index.html | 2 +- doc/iter/Iter/Map/Adapt/index.html | 4 ++-- doc/iter/Iter/Map/Make/index.html | 4 ++-- doc/iter/Iter/Map/index.html | 2 +- doc/iter/Iter/Map/module-type-S/index.html | 4 ++-- doc/iter/Iter/Set/Adapt/index.html | 2 +- doc/iter/Iter/Set/Make/index.html | 2 +- doc/iter/Iter/Set/index.html | 2 +- doc/iter/Iter/Set/module-type-S/index.html | 2 +- doc/iter/Iter/index.html | 7 +++++-- doc/iter/IterBigarray/.dummy | 0 doc/iter/IterBigarray/index.html | 2 +- doc/iter/IterLabels/.dummy | 0 doc/iter/IterLabels/IO/index.html | 2 +- doc/iter/IterLabels/Infix/index.html | 2 +- doc/iter/IterLabels/Map/Adapt/index.html | 4 ++-- doc/iter/IterLabels/Map/Make/index.html | 4 ++-- doc/iter/IterLabels/Map/index.html | 2 +- doc/iter/IterLabels/Map/module-type-S/index.html | 4 ++-- doc/iter/IterLabels/Set/Adapt/index.html | 2 +- doc/iter/IterLabels/Set/Make/index.html | 2 +- doc/iter/IterLabels/Set/index.html | 2 +- doc/iter/IterLabels/Set/module-type-S/index.html | 2 +- doc/iter/IterLabels/index.html | 2 +- doc/iter/index.html | 2 +- .../fonts/KaTeX_AMS-Regular.woff2 | Bin .../fonts/KaTeX_Caligraphic-Bold.woff2 | Bin .../fonts/KaTeX_Caligraphic-Regular.woff2 | Bin .../fonts/KaTeX_Fraktur-Bold.woff2 | Bin .../fonts/KaTeX_Fraktur-Regular.woff2 | Bin .../fonts/KaTeX_Main-Bold.woff2 | Bin .../fonts/KaTeX_Main-BoldItalic.woff2 | Bin .../fonts/KaTeX_Main-Italic.woff2 | Bin .../fonts/KaTeX_Main-Regular.woff2 | Bin .../fonts/KaTeX_Math-BoldItalic.woff2 | Bin .../fonts/KaTeX_Math-Italic.woff2 | Bin .../fonts/KaTeX_SansSerif-Bold.woff2 | Bin .../fonts/KaTeX_SansSerif-Italic.woff2 | Bin .../fonts/KaTeX_SansSerif-Regular.woff2 | Bin .../fonts/KaTeX_Script-Regular.woff2 | Bin .../fonts/KaTeX_Size1-Regular.woff2 | Bin .../fonts/KaTeX_Size2-Regular.woff2 | Bin .../fonts/KaTeX_Size3-Regular.woff2 | Bin .../fonts/KaTeX_Size4-Regular.woff2 | Bin .../fonts/KaTeX_Typewriter-Regular.woff2 | Bin .../highlight.pack.js | 0 doc/{_odoc_support => odoc.support}/katex.min.css | 0 doc/{_odoc_support => odoc.support}/katex.min.js | 0 doc/{_odoc_support => odoc.support}/odoc.css | 0 52 files changed, 36 insertions(+), 33 deletions(-) delete mode 100644 doc/iter/Iter/.dummy delete mode 100644 doc/iter/IterBigarray/.dummy delete mode 100644 doc/iter/IterLabels/.dummy rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_AMS-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Caligraphic-Bold.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Caligraphic-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Fraktur-Bold.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Fraktur-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Main-Bold.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Main-BoldItalic.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Main-Italic.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Main-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Math-BoldItalic.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Math-Italic.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_SansSerif-Bold.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_SansSerif-Italic.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_SansSerif-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Script-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Size1-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Size2-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Size3-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Size4-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/fonts/KaTeX_Typewriter-Regular.woff2 (100%) rename doc/{_odoc_support => odoc.support}/highlight.pack.js (100%) rename doc/{_odoc_support => odoc.support}/katex.min.css (100%) rename doc/{_odoc_support => odoc.support}/katex.min.js (100%) rename doc/{_odoc_support => odoc.support}/odoc.css (100%) diff --git a/doc/index.html b/doc/index.html index 61e6bf0..3dc79b0 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ index - + @@ -11,7 +11,7 @@

OCaml package documentation

    -
  1. iter 1.7
  2. +
  3. iter 1.7-8-g4f47de6
diff --git a/doc/iter/Iter/.dummy b/doc/iter/Iter/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/doc/iter/Iter/IO/index.html b/doc/iter/Iter/IO/index.html index 55813d1..0258298 100644 --- a/doc/iter/Iter/IO/index.html +++ b/doc/iter/Iter/IO/index.html @@ -1,5 +1,5 @@ -IO (iter.Iter.IO)

Module Iter.IO

Basic IO

Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.

Example: copy a file "a" into file "b", removing blank lines:

Iterator.(IO.lines_of "a" |> filter (fun l-> l<> "") |> IO.write_lines "b");;

By chunks of 4096 bytes:

Iterator.IO.(chunks_of ~size:4096 "a" |> write_to "b");;

Read the lines of a file into a list:

Iterator.IO.lines "a" |> Iterator.to_list
val lines_of : ?mode:int -> ?flags:Stdlib.open_flag list -> string -> string t

lines_of filename reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from End_of_file (which is caught). The file is always properly closed. Every time the iterator is iterated on, the file is opened again, so different iterations might return different results

  • parameter mode

    default 0o644

  • parameter flags

    default: [Open_rdonly]

val chunks_of : +IO (iter.Iter.IO)

Module Iter.IO

Basic IO

Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.

Example: copy a file "a" into file "b", removing blank lines:

Iterator.(IO.lines_of "a" |> filter (fun l-> l<> "") |> IO.write_lines "b");;

By chunks of 4096 bytes:

Iterator.IO.(chunks_of ~size:4096 "a" |> write_to "b");;

Read the lines of a file into a list:

Iterator.IO.lines "a" |> Iterator.to_list
  • since 0.5.1
val lines_of : ?mode:int -> ?flags:Stdlib.open_flag list -> string -> string t

lines_of filename reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from End_of_file (which is caught). The file is always properly closed. Every time the iterator is iterated on, the file is opened again, so different iterations might return different results

  • parameter mode

    default 0o644

  • parameter flags

    default: [Open_rdonly]

val chunks_of : ?mode:int -> ?flags:Stdlib.open_flag list -> ?size:int -> diff --git a/doc/iter/Iter/Infix/index.html b/doc/iter/Iter/Infix/index.html index 27e638b..2da4663 100644 --- a/doc/iter/Iter/Infix/index.html +++ b/doc/iter/Iter/Infix/index.html @@ -1,2 +1,2 @@ -Infix (iter.Iter.Infix)

Module Iter.Infix

val (--) : int -> int -> int t

a -- b is the range of integers from a to b, both included, in increasing order. It will therefore be empty if a > b.

val (--^) : int -> int -> int t

a --^ b is the range of integers from b to a, both included, in decreasing order (starts from a). It will therefore be empty if a < b.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Monadic bind (infix version of flat_map

  • since 0.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

Infix version of map

  • since 0.5
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

Applicative operator (product+application)

  • since 0.5
val (<+>) : 'a t -> 'a t -> 'a t

Concatenation of iterators

  • since 0.5
val let+ : 'a t -> ('a -> 'b) -> 'b t

Alias for map

  • since 1.7
val and+ : 'a t -> 'b t -> ('a * 'b) t

Alias for product

  • since 1.7
val let* : 'a t -> ('a -> 'b t) -> 'b t

Alias for flat_map

  • since 1.7
val and* : 'a t -> 'b t -> ('a * 'b) t

Alias for product

  • since 1.7
\ No newline at end of file +Infix (iter.Iter.Infix)

Module Iter.Infix

val (--) : int -> int -> int t

a -- b is the range of integers from a to b, both included, in increasing order. It will therefore be empty if a > b.

val (--^) : int -> int -> int t

a --^ b is the range of integers from b to a, both included, in decreasing order (starts from a). It will therefore be empty if a < b.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Monadic bind (infix version of flat_map

  • since 0.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

Infix version of map

  • since 0.5
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

Applicative operator (product+application)

  • since 0.5
val (<+>) : 'a t -> 'a t -> 'a t

Concatenation of iterators

  • since 0.5
val let+ : 'a t -> ('a -> 'b) -> 'b t

Alias for map

  • since 1.7
val and+ : 'a t -> 'b t -> ('a * 'b) t

Alias for product

  • since 1.7
val let* : 'a t -> ('a -> 'b t) -> 'b t

Alias for flat_map

  • since 1.7
val and* : 'a t -> 'b t -> ('a * 'b) t

Alias for product

  • since 1.7
\ No newline at end of file diff --git a/doc/iter/Iter/Map/Adapt/index.html b/doc/iter/Iter/Map/Adapt/index.html index c7fcea8..dfc011d 100644 --- a/doc/iter/Iter/Map/Adapt/index.html +++ b/doc/iter/Iter/Map/Adapt/index.html @@ -1,6 +1,6 @@ -Adapt (iter.Iter.Map.Adapt)

Module Map.Adapt

Adapt a pre-existing Map module to make it iterator-aware

Parameters

module M : Stdlib.Map.S

Signature

include Stdlib.Map.S with type key = M.key with type 'a t = 'a M.t
type key = M.key
type 'a t = 'a M.t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +Adapt (iter.Iter.Map.Adapt)

Module Map.Adapt

Adapt a pre-existing Map module to make it iterator-aware

Parameters

module M : Stdlib.Map.S

Signature

include Stdlib.Map.S with type key = M.key with type 'a t = 'a M.t
type key = M.key
type 'a t = 'a M.t
val empty : 'a t
val add : key -> 'a -> 'a t -> 'a t
val add_to_list : key -> 'a -> 'a list t -> 'a list t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> - 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file + 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val split : key -> 'a t -> 'a t * 'a option * 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file diff --git a/doc/iter/Iter/Map/Make/index.html b/doc/iter/Iter/Map/Make/index.html index d2f8b2e..21237ed 100644 --- a/doc/iter/Iter/Map/Make/index.html +++ b/doc/iter/Iter/Map/Make/index.html @@ -1,6 +1,6 @@ -Make (iter.Iter.Map.Make)

Module Map.Make

Create an enriched Map module, with iterator-aware functions

Parameters

module V : Stdlib.Map.OrderedType

Signature

include Stdlib.Map.S with type key = V.t
type key = V.t
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +Make (iter.Iter.Map.Make)

Module Map.Make

Create an enriched Map module, with iterator-aware functions

Parameters

module V : Stdlib.Map.OrderedType

Signature

include Stdlib.Map.S with type key = V.t
type key = V.t
type !+'a t
val empty : 'a t
val add : key -> 'a -> 'a t -> 'a t
val add_to_list : key -> 'a -> 'a list t -> 'a list t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> - 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file + 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val split : key -> 'a t -> 'a t * 'a option * 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file diff --git a/doc/iter/Iter/Map/index.html b/doc/iter/Iter/Map/index.html index 5d8efcc..16991f6 100644 --- a/doc/iter/Iter/Map/index.html +++ b/doc/iter/Iter/Map/index.html @@ -1,4 +1,4 @@ -Map (iter.Iter.Map)

Module Iter.Map

module type S = sig ... end
module Adapt +Map (iter.Iter.Map)

Module Iter.Map

module type S = sig ... end
module Adapt (M : Stdlib.Map.S) : S with type key = M.key and type 'a t = 'a M.t

Adapt a pre-existing Map module to make it iterator-aware

module Make (V : Stdlib.Map.OrderedType) : S with type key = V.t

Create an enriched Map module, with iterator-aware functions

\ No newline at end of file diff --git a/doc/iter/Iter/Map/module-type-S/index.html b/doc/iter/Iter/Map/module-type-S/index.html index 64f85f9..fab9611 100644 --- a/doc/iter/Iter/Map/module-type-S/index.html +++ b/doc/iter/Iter/Map/module-type-S/index.html @@ -1,6 +1,6 @@ -S (iter.Iter.Map.S)

Module type Map.S

include Stdlib.Map.S
type key
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +S (iter.Iter.Map.S)

Module type Map.S

include Stdlib.Map.S
type key
type !+'a t
val empty : 'a t
val add : key -> 'a -> 'a t -> 'a t
val add_to_list : key -> 'a -> 'a list t -> 'a list t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> - 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file + 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val split : key -> 'a t -> 'a t * 'a option * 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file diff --git a/doc/iter/Iter/Set/Adapt/index.html b/doc/iter/Iter/Set/Adapt/index.html index d65ae1e..dbfb56f 100644 --- a/doc/iter/Iter/Set/Adapt/index.html +++ b/doc/iter/Iter/Set/Adapt/index.html @@ -1,2 +1,2 @@ -Adapt (iter.Iter.Set.Adapt)

Module Set.Adapt

Create an enriched Set module from the given one

Parameters

module X : Stdlib.Set.S

Signature

include Stdlib.Set.S with type elt = X.elt with type t = X.t
type elt = X.elt
type t = X.t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file +Adapt (iter.Iter.Set.Adapt)

Module Set.Adapt

Create an enriched Set module from the given one

Parameters

module X : Stdlib.Set.S

Signature

include Stdlib.Set.S with type elt = X.elt with type t = X.t
type elt = X.elt
type t = X.t
val empty : t
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val map : (elt -> elt) -> t -> t
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val is_empty : t -> bool
val mem : elt -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val subset : t -> t -> bool
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file diff --git a/doc/iter/Iter/Set/Make/index.html b/doc/iter/Iter/Set/Make/index.html index 43f0640..3a7c44a 100644 --- a/doc/iter/Iter/Set/Make/index.html +++ b/doc/iter/Iter/Set/Make/index.html @@ -1,2 +1,2 @@ -Make (iter.Iter.Set.Make)

Module Set.Make

Functor to build an extended Set module from an ordered type

Parameters

module X : Stdlib.Set.OrderedType

Signature

include Stdlib.Set.S with type elt = X.t
type elt = X.t
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file +Make (iter.Iter.Set.Make)

Module Set.Make

Functor to build an extended Set module from an ordered type

Parameters

module X : Stdlib.Set.OrderedType

Signature

include Stdlib.Set.S with type elt = X.t
type elt = X.t
type t
val empty : t
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val map : (elt -> elt) -> t -> t
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val is_empty : t -> bool
val mem : elt -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val subset : t -> t -> bool
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file diff --git a/doc/iter/Iter/Set/index.html b/doc/iter/Iter/Set/index.html index 83c3748..5e6b5ce 100644 --- a/doc/iter/Iter/Set/index.html +++ b/doc/iter/Iter/Set/index.html @@ -1,2 +1,2 @@ -Set (iter.Iter.Set)

Module Iter.Set

module type S = sig ... end
module Adapt (X : Stdlib.Set.S) : S with type elt = X.elt and type t = X.t

Create an enriched Set module from the given one

module Make (X : Stdlib.Set.OrderedType) : S with type elt = X.t

Functor to build an extended Set module from an ordered type

\ No newline at end of file +Set (iter.Iter.Set)

Module Iter.Set

module type S = sig ... end
module Adapt (X : Stdlib.Set.S) : S with type elt = X.elt and type t = X.t

Create an enriched Set module from the given one

module Make (X : Stdlib.Set.OrderedType) : S with type elt = X.t

Functor to build an extended Set module from an ordered type

\ No newline at end of file diff --git a/doc/iter/Iter/Set/module-type-S/index.html b/doc/iter/Iter/Set/module-type-S/index.html index c349b27..8f0d151 100644 --- a/doc/iter/Iter/Set/module-type-S/index.html +++ b/doc/iter/Iter/Set/module-type-S/index.html @@ -1,2 +1,2 @@ -S (iter.Iter.Set.S)

Module type Set.S

include Stdlib.Set.S
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file +S (iter.Iter.Set.S)

Module type Set.S

include Stdlib.Set.S
type elt
type t
val empty : t
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val map : (elt -> elt) -> t -> t
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val is_empty : t -> bool
val mem : elt -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val subset : t -> t -> bool
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file diff --git a/doc/iter/Iter/index.html b/doc/iter/Iter/index.html index 6424890..8ec4a42 100644 --- a/doc/iter/Iter/index.html +++ b/doc/iter/Iter/index.html @@ -1,5 +1,5 @@ -Iter (iter.Iter)

Module Iter

Simple and Efficient Iterators.

The iterators are designed to allow easy transfer (mappings) between data structures, without defining n^2 conversions between the n types. The implementation relies on the assumption that an iterator can be iterated on as many times as needed; this choice allows for high performance of many combinators. However, for transient iterators, the persistent function is provided, storing elements of a transient iterator in memory; the iterator can then be used several times (See further).

Note that some combinators also return iterators (e.g. group). The transformation is computed on the fly every time one iterates over the resulting iterator. If a transformation performs heavy computation, persistent can also be used as intermediate storage.

Most functions are lazy, i.e. they do not actually use their arguments until their result is iterated on. For instance, if one calls map on an iterator, one gets a new iterator, but nothing else happens until this new iterator is used (by folding or iterating on it).

If an iterator is built from an iteration function that is repeatable (i.e. calling it several times always iterates on the same set of elements, for instance List.iter or Map.iter), then the resulting t object is also repeatable. For one-time iter functions such as iteration on a file descriptor or a Seq, the persistent function can be used to iterate and store elements in a memory structure; the result is an iterator that iterates on the elements of this memory structure, cheaply and repeatably.

type +'a t = ('a -> unit) -> unit

An iterator of values of type 'a. If you give it a function 'a -> unit it will be applied to every element of the iterator successively.

type +'a iter = 'a t
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int

Creation

val from_iter : (('a -> unit) -> unit) -> 'a t

Build an iterator from a iter function

val from_labelled_iter : (f:('a -> unit) -> unit) -> 'a t

Build an iterator from a labelled iter function

  • since 1.2
val from_fun : (unit -> 'a option) -> 'a t

Call the function repeatedly until it returns None. This iterator is transient, use persistent if needed!

val empty : 'a t

Empty iterator. It contains no element.

val singleton : 'a -> 'a t

Singleton iterator, with exactly one element.

val doubleton : 'a -> 'a -> 'a t

Iterator with exactly two elements

val init : (int -> 'a) -> 'a t

init f is the infinite iterator f 0; f 1; f 2; ….

  • since 0.9
val cons : 'a -> 'a t -> 'a t

cons x l yields x, then yields from l. Same as append (singleton x) l.

Caution: it is advised not to build long iterators out of cons, because it's inefficient. Each additional cons x i adds one layer of function call per item traversed in i.

val snoc : 'a t -> 'a -> 'a t

Same as cons but yields the element after iterating on l.

val return : 'a -> 'a t

Synonym to singleton

val pure : 'a -> 'a t

Synonym to singleton

val repeat : 'a -> 'a t

Infinite iterator of the same element. You may want to look at take and the likes if you iterate on it.

val iterate : ('a -> 'a) -> 'a -> 'a t

iterate f x is the infinite iterator x, f(x), f(f(x)), ...

val forever : (unit -> 'b) -> 'b t

Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.

val cycle : 'a t -> 'a t

Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.

val unfoldr : ('b -> ('a * 'b) option) -> 'b -> 'a t

unfoldr f b will apply f to b. If it yields Some (x,b') then x is returned and unfoldr recurses with b'.

val scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t

Iterator of intermediate results

Consumption

val iter : ('a -> unit) -> 'a t -> unit

Consume the iterator, passing all its arguments to the function. Basically iter f seq is just seq f.

val iteri : (int -> 'a -> unit) -> 'a t -> unit

Iterate on elements and their index in the iterator

val for_each : 'a t -> ('a -> unit) -> unit

Consume the iterator, passing all its arguments to the function. for_each seq f is the same as iter f seq, i.e., iter with arguments reversed.

  • since 1.4
val for_eachi : 'a t -> (int -> 'a -> unit) -> unit

Iterate on elements and their index in the iterator. for_eachi seq f is the same as iteri f seq, i.e., iteri with arguments reversed.

  • since 1.4
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a

Fold over elements of the iterator, consuming it

val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a

Fold over elements of the iterator and their index, consuming it

val fold_map : ('acc -> 'a -> 'acc * 'b) -> 'acc -> 'a t -> 'b t

fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.

  • since 0.9
val fold_filter_map : ('acc -> 'a -> 'acc * 'b option) -> 'acc -> 'a t -> 'b t

fold_filter_map f acc l is a fold_map-like function, but the function can choose to skip an element by retuning None.

  • since 0.9
val map : ('a -> 'b) -> 'a t -> 'b t

Map objects of the iterator into other elements, lazily

val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

Map objects, along with their index in the iterator

val map_by_2 : ('a -> 'a -> 'a) -> 'a t -> 'a t

Map objects two by two. lazily. The last element is kept in the iterator if the count is odd.

  • since 0.7
val for_all : ('a -> bool) -> 'a t -> bool

Do all elements satisfy the predicate?

val exists : ('a -> bool) -> 'a t -> bool

Exists there some element satisfying the predicate?

val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool

Is the value a member of the iterator?

  • parameter eq

    the equality predicate to use (default (=))

  • since 0.5
val find : ('a -> 'b option) -> 'a t -> 'b option

Find the first element on which the function doesn't return None

  • since 0.5
val find_map : ('a -> 'b option) -> 'a t -> 'b option

Alias to find

  • since 0.10
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option

Indexed version of find

  • since 0.9
val find_mapi : (int -> 'a -> 'b option) -> 'a t -> 'b option

Alias to findi

  • since 0.10
val find_pred : ('a -> bool) -> 'a t -> 'a option

find_pred p l finds the first element of l that satisfies p, or returns None if no element satisfies p

  • since 0.9
val find_pred_exn : ('a -> bool) -> 'a t -> 'a

Unsafe version of find_pred

  • raises Not_found

    if no such element is found

  • since 0.9
val length : 'a t -> int

How long is the iterator? Forces the iterator.

val is_empty : 'a t -> bool

Is the iterator empty? Forces the iterator.

Transformation

val filter : ('a -> bool) -> 'a t -> 'a t

Filter on elements of the iterator

val append : 'a t -> 'a t -> 'a t

Append two iterators. Iterating on the result is like iterating on the first, then on the second.

val append_l : 'a t list -> 'a t

Append iterators. Iterating on the result is like iterating on the each iterator of the list in order.

  • since 0.11
val concat : 'a t t -> 'a t

Concatenate an iterator of iterators into one iterator.

val flatten : 'a t t -> 'a t

Alias for concat

val flat_map : ('a -> 'b t) -> 'a t -> 'b t

Monadic bind. Intuitively, it applies the function to every element of the initial iterator, and calls concat. Formerly flatMap

  • since 0.5
val flat_map_l : ('a -> 'b list) -> 'a t -> 'b t

Convenience function combining flat_map and of_list

  • since 0.9
val seq_list : 'a t list -> 'a list t

seq_list l returns all the ways to pick one element in each sub-iterator in l. Assumes the sub-iterators can be iterated on several times.

  • since 0.11
val seq_list_map : ('a -> 'b t) -> 'a list -> 'b list t

seq_list_map f l maps f over every element of l, then calls seq_list

  • since 0.11
val filter_map : ('a -> 'b option) -> 'a t -> 'b t

Map and only keep non-None elements Formerly fmap

  • since 0.5
val filter_mapi : (int -> 'a -> 'b option) -> 'a t -> 'b t

Map with indices, and only keep non-None elements

  • since 0.11
val filter_count : ('a -> bool) -> 'a t -> int

Count how many elements satisfy the given predicate

  • since 1.0
val intersperse : 'a -> 'a t -> 'a t

Insert the single element between every element of the iterator

val keep_some : 'a option t -> 'a t

filter_some l retains only elements of the form Some x. Same as filter_map (fun x->x)

  • since 1.0
val keep_ok : ('a, _) Stdlib.result t -> 'a t

keep_ok l retains only elements of the form Ok x.

  • since 1.0
val keep_error : (_, 'e) Stdlib.result t -> 'e t

keep_error l retains only elements of the form Error x.

  • since 1.0

Caching

val persistent : 'a t -> 'a t

Iterate on the iterator, storing elements in an efficient internal structure.. The resulting iterator can be iterated on as many times as needed. Note: calling persistent on an already persistent iterator will still make a new copy of the iterator!

val persistent_lazy : 'a t -> 'a t

Lazy version of persistent. When calling persistent_lazy s, a new iterator s' is immediately returned (without actually consuming s) in constant time; the first time s' is iterated on, it also consumes s and caches its content into a inner data structure that will back s' for future iterations.

warning: on the first traversal of s', if the traversal is interrupted prematurely (take, etc.) then s' will not be memorized, and the next call to s' will traverse s again.

Misc

val sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t

Sort the iterator. Eager, O(n) ram and O(n ln(n)) time. It iterates on elements of the argument iterator immediately, before it sorts them.

val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t

Sort the iterator and remove duplicates. Eager, same as sort

val sorted : ?cmp:('a -> 'a -> int) -> 'a t -> bool

Checks whether the iterator is sorted. Eager, same as sort.

  • since 0.9
val group_succ_by : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list t

Group equal consecutive elements. Linear time. Formerly synonym to group. note: Order of items in each list is unspecified.

  • since 0.6
val group_by : ?hash:('a -> int) -> ?eq:('a -> 'a -> bool) -> 'a t -> 'a list t

Group equal elements, disregarding their order of appearance. precondition: for any x and y, if eq x y then hash x=hash y must hold. note: Order of items in each list is unspecified.

  • since 0.6
val count : ?hash:('a -> int) -> ?eq:('a -> 'a -> bool) -> 'a t -> ('a * int) t

Map each distinct element to its number of occurrences in the whole seq. Similar to group_by seq |> map (fun l->List.hd l, List.length l) precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10
val uniq : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t

Remove consecutive duplicate elements. Basically this is like fun seq -> map List.hd (group seq).

val product : 'a t -> 'b t -> ('a * 'b) t

Cartesian product of iterators. When calling product a b, the caller MUST ensure that b can be traversed as many times as required (several times), possibly by calling persistent on it beforehand.

val diagonal_l : 'a list -> ('a * 'a) t

All pairs of distinct positions of the list. diagonal l will return the iterator of all List.nth i l, List.nth j l if i < j.

  • since 0.9
val diagonal : 'a t -> ('a * 'a) t

All pairs of distinct positions of the iterator. Iterates only once on the iterator, which must be finite.

  • since 0.9
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.

val join_by : +Iter (iter.Iter)

Module Iter

Simple and Efficient Iterators.

The iterators are designed to allow easy transfer (mappings) between data structures, without defining n^2 conversions between the n types. The implementation relies on the assumption that an iterator can be iterated on as many times as needed; this choice allows for high performance of many combinators. However, for transient iterators, the persistent function is provided, storing elements of a transient iterator in memory; the iterator can then be used several times (See further).

Note that some combinators also return iterators (e.g. group). The transformation is computed on the fly every time one iterates over the resulting iterator. If a transformation performs heavy computation, persistent can also be used as intermediate storage.

Most functions are lazy, i.e. they do not actually use their arguments until their result is iterated on. For instance, if one calls map on an iterator, one gets a new iterator, but nothing else happens until this new iterator is used (by folding or iterating on it).

If an iterator is built from an iteration function that is repeatable (i.e. calling it several times always iterates on the same set of elements, for instance List.iter or Map.iter), then the resulting t object is also repeatable. For one-time iter functions such as iteration on a file descriptor or a Seq, the persistent function can be used to iterate and store elements in a memory structure; the result is an iterator that iterates on the elements of this memory structure, cheaply and repeatably.

type +'a t = ('a -> unit) -> unit

An iterator of values of type 'a. If you give it a function 'a -> unit it will be applied to every element of the iterator successively.

type +'a iter = 'a t
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int

Creation

val from_iter : (('a -> unit) -> unit) -> 'a t

Build an iterator from a iter function

val from_labelled_iter : (f:('a -> unit) -> unit) -> 'a t

Build an iterator from a labelled iter function

  • since 1.2
val from_fun : (unit -> 'a option) -> 'a t

Call the function repeatedly until it returns None. This iterator is transient, use persistent if needed!

val empty : 'a t

Empty iterator. It contains no element.

val singleton : 'a -> 'a t

Singleton iterator, with exactly one element.

val doubleton : 'a -> 'a -> 'a t

Iterator with exactly two elements

val init : (int -> 'a) -> 'a t

init f is the infinite iterator f 0; f 1; f 2; ….

  • since 0.9
val cons : 'a -> 'a t -> 'a t

cons x l yields x, then yields from l. Same as append (singleton x) l.

Caution: it is advised not to build long iterators out of cons, because it's inefficient. Each additional cons x i adds one layer of function call per item traversed in i.

val snoc : 'a t -> 'a -> 'a t

Same as cons but yields the element after iterating on l.

val return : 'a -> 'a t

Synonym to singleton

val pure : 'a -> 'a t

Synonym to singleton

val repeat : 'a -> 'a t

Infinite iterator of the same element. You may want to look at take and the likes if you iterate on it.

val iterate : ('a -> 'a) -> 'a -> 'a t

iterate f x is the infinite iterator x, f(x), f(f(x)), ...

val forever : (unit -> 'b) -> 'b t

Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.

val cycle : 'a t -> 'a t

Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.

val unfoldr : ('b -> ('a * 'b) option) -> 'b -> 'a t

unfoldr f b will apply f to b. If it yields Some (x,b') then x is returned and unfoldr recurses with b'.

val scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t

Iterator of intermediate results

Consumption

val iter : ('a -> unit) -> 'a t -> unit

Consume the iterator, passing all its arguments to the function. Basically iter f seq is just seq f.

val iteri : (int -> 'a -> unit) -> 'a t -> unit

Iterate on elements and their index in the iterator

val for_each : 'a t -> ('a -> unit) -> unit

Consume the iterator, passing all its arguments to the function. for_each seq f is the same as iter f seq, i.e., iter with arguments reversed.

  • since 1.4
val for_eachi : 'a t -> (int -> 'a -> unit) -> unit

Iterate on elements and their index in the iterator. for_eachi seq f is the same as iteri f seq, i.e., iteri with arguments reversed.

  • since 1.4
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a

Fold over elements of the iterator, consuming it

val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a

Fold over elements of the iterator and their index, consuming it

val fold_map : ('acc -> 'a -> 'acc * 'b) -> 'acc -> 'a t -> 'b t

fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.

  • since 0.9
val fold_filter_map : ('acc -> 'a -> 'acc * 'b option) -> 'acc -> 'a t -> 'b t

fold_filter_map f acc l is a fold_map-like function, but the function can choose to skip an element by retuning None.

  • since 0.9
val map : ('a -> 'b) -> 'a t -> 'b t

Map objects of the iterator into other elements, lazily

val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

Map objects, along with their index in the iterator

val map_by_2 : ('a -> 'a -> 'a) -> 'a t -> 'a t

Map objects two by two. lazily. The last element is kept in the iterator if the count is odd.

  • since 0.7
val for_all : ('a -> bool) -> 'a t -> bool

Do all elements satisfy the predicate?

val exists : ('a -> bool) -> 'a t -> bool

Exists there some element satisfying the predicate?

val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool

Is the value a member of the iterator?

  • parameter eq

    the equality predicate to use (default (=))

  • since 0.5
val find : ('a -> 'b option) -> 'a t -> 'b option

Find the first element on which the function doesn't return None

  • since 0.5
val find_map : ('a -> 'b option) -> 'a t -> 'b option

Alias to find

  • since 0.10
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option

Indexed version of find

  • since 0.9
val find_mapi : (int -> 'a -> 'b option) -> 'a t -> 'b option

Alias to findi

  • since 0.10
val find_pred : ('a -> bool) -> 'a t -> 'a option

find_pred p l finds the first element of l that satisfies p, or returns None if no element satisfies p

  • since 0.9
val find_pred_exn : ('a -> bool) -> 'a t -> 'a

Unsafe version of find_pred

  • raises Not_found

    if no such element is found

  • since 0.9
val length : 'a t -> int

How long is the iterator? Forces the iterator.

val is_empty : 'a t -> bool

Is the iterator empty? Forces the iterator.

Transformation

val filter : ('a -> bool) -> 'a t -> 'a t

Filter on elements of the iterator

val append : 'a t -> 'a t -> 'a t

Append two iterators. Iterating on the result is like iterating on the first, then on the second.

val append_l : 'a t list -> 'a t

Append iterators. Iterating on the result is like iterating on the each iterator of the list in order.

  • since 0.11
val concat : 'a t t -> 'a t

Concatenate an iterator of iterators into one iterator.

val flatten : 'a t t -> 'a t

Alias for concat

val flat_map : ('a -> 'b t) -> 'a t -> 'b t

Monadic bind. Intuitively, it applies the function to every element of the initial iterator, and calls concat. Formerly flatMap

  • since 0.5
val flat_map_l : ('a -> 'b list) -> 'a t -> 'b t

Convenience function combining flat_map and of_list

  • since 0.9
val seq_list : 'a t list -> 'a list t

seq_list l returns all the ways to pick one element in each sub-iterator in l. Assumes the sub-iterators can be iterated on several times.

  • since 0.11
val seq_list_map : ('a -> 'b t) -> 'a list -> 'b list t

seq_list_map f l maps f over every element of l, then calls seq_list

  • since 0.11
val filter_map : ('a -> 'b option) -> 'a t -> 'b t

Map and only keep non-None elements Formerly fmap

  • since 0.5
val filter_mapi : (int -> 'a -> 'b option) -> 'a t -> 'b t

Map with indices, and only keep non-None elements

  • since 0.11
val filter_count : ('a -> bool) -> 'a t -> int

Count how many elements satisfy the given predicate

  • since 1.0
val intersperse : 'a -> 'a t -> 'a t

Insert the single element between every element of the iterator

val keep_some : 'a option t -> 'a t

filter_some l retains only elements of the form Some x. Same as filter_map (fun x->x)

  • since 1.0
val keep_ok : ('a, _) Stdlib.result t -> 'a t

keep_ok l retains only elements of the form Ok x.

  • since 1.0
val keep_error : (_, 'e) Stdlib.result t -> 'e t

keep_error l retains only elements of the form Error x.

  • since 1.0

Caching

val persistent : 'a t -> 'a t

Iterate on the iterator, storing elements in an efficient internal structure.. The resulting iterator can be iterated on as many times as needed. Note: calling persistent on an already persistent iterator will still make a new copy of the iterator!

val persistent_lazy : 'a t -> 'a t

Lazy version of persistent. When calling persistent_lazy s, a new iterator s' is immediately returned (without actually consuming s) in constant time; the first time s' is iterated on, it also consumes s and caches its content into a inner data structure that will back s' for future iterations.

warning: on the first traversal of s', if the traversal is interrupted prematurely (take, etc.) then s' will not be memorized, and the next call to s' will traverse s again.

Misc

val sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t

Sort the iterator. Eager, O(n) ram and O(n ln(n)) time. It iterates on elements of the argument iterator immediately, before it sorts them.

val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t

Sort the iterator and remove duplicates. Eager, same as sort

val sorted : ?cmp:('a -> 'a -> int) -> 'a t -> bool

Checks whether the iterator is sorted. Eager, same as sort.

  • since 0.9
val group_succ_by : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list t

Group equal consecutive elements. Linear time. Formerly synonym to group. note: Order of items in each list is unspecified.

  • since 0.6
val group_by : ?hash:('a -> int) -> ?eq:('a -> 'a -> bool) -> 'a t -> 'a list t

Group equal elements, disregarding their order of appearance. precondition: for any x and y, if eq x y then hash x=hash y must hold. note: Order of items in each list is unspecified.

  • since 0.6
val count : ?hash:('a -> int) -> ?eq:('a -> 'a -> bool) -> 'a t -> ('a * int) t

Map each distinct element to its number of occurrences in the whole seq. Similar to group_by seq |> map (fun l->List.hd l, List.length l) precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10
val uniq : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t

Remove consecutive duplicate elements. Basically this is like fun seq -> map List.hd (group seq).

val product : 'a t -> 'b t -> ('a * 'b) t

Cartesian product of iterators. When calling product a b, the caller MUST ensure that b can be traversed as many times as required (several times), possibly by calling persistent on it beforehand.

val diagonal_l : 'a list -> ('a * 'a) t

All pairs of distinct positions of the list. diagonal l will return the iterator of all List.nth i l, List.nth j l if i < j.

  • since 0.9
val diagonal : 'a t -> ('a * 'a) t

All pairs of distinct positions of the iterator. Iterates only once on the iterator, which must be finite.

  • since 0.9
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.

val join_by : ?eq:'key equal -> ?hash:'key hash -> ('a -> 'key) -> @@ -21,7 +21,10 @@ ('b -> 'a) -> 'a t -> 'b t -> - ('a * 'b list) t

group_join_by key2 associates to every element x of the first iterator, all the elements y of the second iterator such that eq x (key y). Elements of the first iterators without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10

Set-like

val inter : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> 'a t

Intersection of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10
val union : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> 'a t

Union of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10
val diff : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> 'a t

Set difference. Eager.

  • since 0.10
val subset : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> bool

subset a b returns true if all elements of a belong to b. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10

Arithmetic

val max : ?lt:('a -> 'a -> bool) -> 'a t -> 'a option

Max element of the iterator, using the given comparison function.

  • returns

    None if the iterator is empty, Some m where m is the maximal element otherwise

val max_exn : ?lt:('a -> 'a -> bool) -> 'a t -> 'a

Unsafe version of max

  • raises Not_found

    if the iterator is empty

  • since 0.10
val min : ?lt:('a -> 'a -> bool) -> 'a t -> 'a option

Min element of the iterator, using the given comparison function. see max for more details.

val min_exn : ?lt:('a -> 'a -> bool) -> 'a t -> 'a

Unsafe version of min

  • raises Not_found

    if the iterator is empty

  • since 0.10
val sum : int t -> int

Sum of elements

  • since 0.11
val sumf : float t -> float

Sum of elements, using Kahan summation

  • since 0.11

List-like

val head : 'a t -> 'a option

First element, if any, otherwise None

  • since 0.5.1
val head_exn : 'a t -> 'a

First element, if any, fails

  • raises Invalid_argument

    if the iterator is empty

  • since 0.5.1
val take : int -> 'a t -> 'a t

Take at most n elements from the iterator. Works on infinite iterators.

val take_while : ('a -> bool) -> 'a t -> 'a t

Take elements while they satisfy the predicate, then stops iterating. Will work on an infinite iterator s if the predicate is false for at least one element of s.

val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'a

Folds over elements of the iterator, stopping early if the accumulator returns ('a, `Stop)

  • since 0.5.5
val drop : int -> 'a t -> 'a t

Drop the n first elements of the iterator. Lazy.

val drop_while : ('a -> bool) -> 'a t -> 'a t

Predicate version of drop

val rev : 'a t -> 'a t

Reverse the iterator. O(n) memory and time, needs the iterator to be finite. The result is persistent and does not depend on the input being repeatable.

val zip_i : 'a t -> (int * 'a) t

Zip elements of the iterator with their index in the iterator.

  • since 1.0 Changed type to just give an iterator of pairs

Pair iterators

val fold2 : ('c -> 'a -> 'b -> 'c) -> 'c -> ('a * 'b) t -> 'c
val iter2 : ('a -> 'b -> unit) -> ('a * 'b) t -> unit
val map2 : ('a -> 'b -> 'c) -> ('a * 'b) t -> 'c t
val map2_2 : ('a -> 'b -> 'c) -> ('a -> 'b -> 'd) -> ('a * 'b) t -> ('c * 'd) t

map2_2 f g seq2 maps each x, y of seq2 into f x y, g x y

Data structures converters

val to_list : 'a t -> 'a list

Convert the iterator into a list. Preserves order of elements. This function is tail-recursive, but consumes 2*n memory. If order doesn't matter to you, consider to_rev_list.

val to_rev_list : 'a t -> 'a list

Get the list of the reversed iterator (more efficient than to_list)

val of_list : 'a list -> 'a t
val on_list : ('a t -> 'b t) -> 'a list -> 'b list

on_list f l is equivalent to to_list @@ f @@ of_list l.

  • since 0.5.2
val pair_with_idx : 'a t -> (int * 'a) t

Similar to zip_i but returns a normal iterator of tuples

  • since 0.11
val to_opt : 'a t -> 'a option

Alias to head

  • since 0.5.1
val to_array : 'a t -> 'a array

Convert to an array. Currently not very efficient because an intermediate list is used.

val of_array : 'a array -> 'a t
val of_array_i : 'a array -> (int * 'a) t

Elements of the array, with their index

val array_slice : 'a array -> int -> int -> 'a t

array_slice a i j Iterator of elements whose indexes range from i to j

val of_opt : 'a option -> 'a t

Iterate on 0 or 1 values.

  • since 0.5.1
val of_seq : 'a Stdlib.Seq.t -> 'a t

Iterator of elements of a Seq.t.

  • since 1.5
val to_seq_persistent : 'a t -> 'a Stdlib.Seq.t

Convert to a Seq. Linear in memory and time (a copy is made in memory). This does not work on infinite iterators.

  • since 1.5
val to_stack : 'a Stdlib.Stack.t -> 'a t -> unit

Push elements of the iterator on the stack

val of_stack : 'a Stdlib.Stack.t -> 'a t

Iterator of elements of the stack (same order as Stack.iter)

val to_queue : 'a Stdlib.Queue.t -> 'a t -> unit

Push elements of the iterator into the queue

val of_queue : 'a Stdlib.Queue.t -> 'a t

Iterator of elements contained in the queue, FIFO order

val hashtbl_add : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) t -> unit

Add elements of the iterator to the hashtable, with Hashtbl.add

val hashtbl_replace : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) t -> unit

Add elements of the iterator to the hashtable, with Hashtbl.replace (erases conflicting bindings)

val to_hashtbl : ('a * 'b) t -> ('a, 'b) Stdlib.Hashtbl.t

Build a hashtable from an iterator of key/value pairs

val of_hashtbl : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) t

Iterator of key/value pairs from the hashtable

val hashtbl_keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a t
val hashtbl_values : ('a, 'b) Stdlib.Hashtbl.t -> 'b t
val of_str : string -> char t
val to_str : char t -> string
val concat_str : string t -> string

Concatenate strings together, eagerly. Also see intersperse to add a separator.

  • since 0.5
exception OneShotSequence

Raised when the user tries to iterate several times on a transient iterator

val of_in_channel : Stdlib.in_channel -> char t

Iterates on characters of the input (can block when one iterates over the iterator). If you need to iterate several times on this iterator, use persistent.

  • raises OneShotIterator

    when used more than once.

val to_buffer : char t -> Stdlib.Buffer.t -> unit

Copy content of the iterator into the buffer

val int_range : start:int -> stop:int -> int t

Iterator on integers in start...stop by steps 1. Also see (--) for an infix version.

val int_range_dec : start:int -> stop:int -> int t

Iterator on decreasing integers in stop...start by steps -1. See (--^) for an infix version

val int_range_by : step:int -> int -> int -> int t

int_range_by ~step i j is the range starting at i, including j, where the difference between successive elements is step. use a negative step for a decreasing iterator.

  • raises Invalid_argument

    if step=0

val bools : bool t

Iterates on true and false

  • since 0.7
val of_set : + ('a * 'b list) t

group_join_by key2 associates to every element x of the first iterator, all the elements y of the second iterator such that eq x (key y). Elements of the first iterators without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10

Set-like

val inter : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> 'a t

Intersection of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10
val union : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> 'a t

Union of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10
val diff : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> 'a t

Set difference. Eager.

  • since 0.10
val subset : ?eq:'a equal -> ?hash:'a hash -> 'a t -> 'a t -> bool

subset a b returns true if all elements of a belong to b. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.

  • since 0.10

Arithmetic

val max : ?lt:('a -> 'a -> bool) -> 'a t -> 'a option

Max element of the iterator, using the given comparison function.

  • returns

    None if the iterator is empty, Some m where m is the maximal element otherwise

val max_exn : ?lt:('a -> 'a -> bool) -> 'a t -> 'a

Unsafe version of max

  • raises Not_found

    if the iterator is empty

  • since 0.10
val min : ?lt:('a -> 'a -> bool) -> 'a t -> 'a option

Min element of the iterator, using the given comparison function. see max for more details.

val min_exn : ?lt:('a -> 'a -> bool) -> 'a t -> 'a

Unsafe version of min

  • raises Not_found

    if the iterator is empty

  • since 0.10
val sum : int t -> int

Sum of elements

  • since 0.11
val sumf : float t -> float

Sum of elements, using Kahan summation

  • since 0.11

List-like

val head : 'a t -> 'a option

First element, if any, otherwise None

  • since 0.5.1
val head_exn : 'a t -> 'a

First element, if any, fails

  • raises Invalid_argument

    if the iterator is empty

  • since 0.5.1
val take : int -> 'a t -> 'a t

Take at most n elements from the iterator. Works on infinite iterators.

val take_while : ('a -> bool) -> 'a t -> 'a t

Take elements while they satisfy the predicate, then stops iterating. Will work on an infinite iterator s if the predicate is false for at least one element of s.

val map_while : + ('a -> [ `Yield of 'b | `Return of 'b | `Stop ]) -> + 'a t -> + 'b t

Maps over elements of the iterator, stopping early if the mapped function returns `Stop or `Return x. At each iteration:

  • If f returns `Yield y, y is added to the sequence and the iteration continues.
  • If f returns `Stop, nothing is added to the sequence and the iteration stops.
  • If f returns `Return y, y is added to the sequence and the iteration stops.
  • since 1.8
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'a

Folds over elements of the iterator, stopping early if the accumulator returns ('a, `Stop)

  • since 0.5.5
val drop : int -> 'a t -> 'a t

Drop the n first elements of the iterator. Lazy.

val drop_while : ('a -> bool) -> 'a t -> 'a t

Predicate version of drop

val rev : 'a t -> 'a t

Reverse the iterator. O(n) memory and time, needs the iterator to be finite. The result is persistent and does not depend on the input being repeatable.

val zip_i : 'a t -> (int * 'a) t

Zip elements of the iterator with their index in the iterator.

  • since 1.0 Changed type to just give an iterator of pairs

Pair iterators

val fold2 : ('c -> 'a -> 'b -> 'c) -> 'c -> ('a * 'b) t -> 'c
val iter2 : ('a -> 'b -> unit) -> ('a * 'b) t -> unit
val map2 : ('a -> 'b -> 'c) -> ('a * 'b) t -> 'c t
val map2_2 : ('a -> 'b -> 'c) -> ('a -> 'b -> 'd) -> ('a * 'b) t -> ('c * 'd) t

map2_2 f g seq2 maps each x, y of seq2 into f x y, g x y

Data structures converters

val to_list : 'a t -> 'a list

Convert the iterator into a list. Preserves order of elements. This function is tail-recursive, but consumes 2*n memory. If order doesn't matter to you, consider to_rev_list.

val to_rev_list : 'a t -> 'a list

Get the list of the reversed iterator (more efficient than to_list)

val of_list : 'a list -> 'a t
val on_list : ('a t -> 'b t) -> 'a list -> 'b list

on_list f l is equivalent to to_list @@ f @@ of_list l.

  • since 0.5.2
val pair_with_idx : 'a t -> (int * 'a) t

Similar to zip_i but returns a normal iterator of tuples

  • since 0.11
val to_opt : 'a t -> 'a option

Alias to head

  • since 0.5.1
val to_array : 'a t -> 'a array

Convert to an array. Currently not very efficient because an intermediate list is used.

val of_array : 'a array -> 'a t
val of_array_i : 'a array -> (int * 'a) t

Elements of the array, with their index

val array_slice : 'a array -> int -> int -> 'a t

array_slice a i j Iterator of elements whose indexes range from i to j

val of_opt : 'a option -> 'a t

Iterate on 0 or 1 values.

  • since 0.5.1
val of_seq : 'a Stdlib.Seq.t -> 'a t

Iterator of elements of a Seq.t.

  • since 1.5
val to_seq_persistent : 'a t -> 'a Stdlib.Seq.t

Convert to a Seq. Linear in memory and time (a copy is made in memory). This does not work on infinite iterators.

  • since 1.5
val to_stack : 'a Stdlib.Stack.t -> 'a t -> unit

Push elements of the iterator on the stack

val of_stack : 'a Stdlib.Stack.t -> 'a t

Iterator of elements of the stack (same order as Stack.iter)

val to_queue : 'a Stdlib.Queue.t -> 'a t -> unit

Push elements of the iterator into the queue

val of_queue : 'a Stdlib.Queue.t -> 'a t

Iterator of elements contained in the queue, FIFO order

val hashtbl_add : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) t -> unit

Add elements of the iterator to the hashtable, with Hashtbl.add

val hashtbl_replace : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) t -> unit

Add elements of the iterator to the hashtable, with Hashtbl.replace (erases conflicting bindings)

val to_hashtbl : ('a * 'b) t -> ('a, 'b) Stdlib.Hashtbl.t

Build a hashtable from an iterator of key/value pairs

val of_hashtbl : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) t

Iterator of key/value pairs from the hashtable

val hashtbl_keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a t
val hashtbl_values : ('a, 'b) Stdlib.Hashtbl.t -> 'b t
val of_str : string -> char t
val to_str : char t -> string
val concat_str : string t -> string

Concatenate strings together, eagerly. Also see intersperse to add a separator.

  • since 0.5
exception OneShotSequence

Raised when the user tries to iterate several times on a transient iterator

val of_in_channel : Stdlib.in_channel -> char t

Iterates on characters of the input (can block when one iterates over the iterator). If you need to iterate several times on this iterator, use persistent.

  • raises OneShotIterator

    when used more than once.

val to_buffer : char t -> Stdlib.Buffer.t -> unit

Copy content of the iterator into the buffer

val int_range : start:int -> stop:int -> int t

Iterator on integers in start...stop by steps 1. Also see (--) for an infix version.

val int_range_dec : start:int -> stop:int -> int t

Iterator on decreasing integers in stop...start by steps -1. See (--^) for an infix version

val int_range_by : step:int -> int -> int -> int t

int_range_by ~step i j is the range starting at i, including j, where the difference between successive elements is step. use a negative step for a decreasing iterator.

  • raises Invalid_argument

    if step=0

val bools : bool t

Iterates on true and false

  • since 0.7
val of_set : (module Stdlib.Set.S with type elt = 'a and type t = 'b) -> 'b -> 'a t

Convert the given set to an iterator. The set module must be provided.

val to_set : diff --git a/doc/iter/IterBigarray/.dummy b/doc/iter/IterBigarray/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/doc/iter/IterBigarray/index.html b/doc/iter/IterBigarray/index.html index eb7059d..b62a2f1 100644 --- a/doc/iter/IterBigarray/index.html +++ b/doc/iter/IterBigarray/index.html @@ -1,2 +1,2 @@ -IterBigarray (iter.IterBigarray)

Module IterBigarray

Interface and Helpers for bigarrays

  • since 0.5.4
val of_bigarray : ('a, _, _) Stdlib.Bigarray.Array1.t -> 'a Iter.t

Iterate on the elements of a 1-D array

val mmap : string -> char Iter.t

Map the file into memory, and read the characters.

\ No newline at end of file +IterBigarray (iter.IterBigarray)

Module IterBigarray

Interface and Helpers for bigarrays

  • since 0.5.4
val of_bigarray : ('a, _, _) Stdlib.Bigarray.Array1.t -> 'a Iter.t

Iterate on the elements of a 1-D array

val mmap : string -> char Iter.t

Map the file into memory, and read the characters.

\ No newline at end of file diff --git a/doc/iter/IterLabels/.dummy b/doc/iter/IterLabels/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/doc/iter/IterLabels/IO/index.html b/doc/iter/IterLabels/IO/index.html index eb00046..d917ed5 100644 --- a/doc/iter/IterLabels/IO/index.html +++ b/doc/iter/IterLabels/IO/index.html @@ -1,5 +1,5 @@ -IO (iter.IterLabels.IO)

Module IterLabels.IO

val lines_of : ?mode:int -> ?flags:Stdlib.open_flag list -> string -> string t

lines_of filename reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from End_of_file (which is caught). The file is always properly closed. Every time the iterator is iterated on, the file is opened again, so different iterations might return different results

  • parameter mode

    default 0o644

  • parameter flags

    default: [Open_rdonly]

val chunks_of : +IO (iter.IterLabels.IO)

Module IterLabels.IO

val lines_of : ?mode:int -> ?flags:Stdlib.open_flag list -> string -> string t

lines_of filename reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from End_of_file (which is caught). The file is always properly closed. Every time the iterator is iterated on, the file is opened again, so different iterations might return different results

  • parameter mode

    default 0o644

  • parameter flags

    default: [Open_rdonly]

val chunks_of : ?mode:int -> ?flags:Stdlib.open_flag list -> ?size:int -> diff --git a/doc/iter/IterLabels/Infix/index.html b/doc/iter/IterLabels/Infix/index.html index 3f70aeb..436d348 100644 --- a/doc/iter/IterLabels/Infix/index.html +++ b/doc/iter/IterLabels/Infix/index.html @@ -1,2 +1,2 @@ -Infix (iter.IterLabels.Infix)

Module IterLabels.Infix

val (--) : int -> int -> int t

a -- b is the range of integers from a to b, both included, in increasing order. It will therefore be empty if a > b.

val (--^) : int -> int -> int t

a --^ b is the range of integers from b to a, both included, in decreasing order (starts from a). It will therefore be empty if a < b.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Monadic bind (infix version of flat_map

  • since 0.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

Infix version of map

  • since 0.5
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

Applicative operator (product+application)

  • since 0.5
val (<+>) : 'a t -> 'a t -> 'a t

Concatenation of iterators

  • since 0.5
\ No newline at end of file +Infix (iter.IterLabels.Infix)

Module IterLabels.Infix

val (--) : int -> int -> int t

a -- b is the range of integers from a to b, both included, in increasing order. It will therefore be empty if a > b.

val (--^) : int -> int -> int t

a --^ b is the range of integers from b to a, both included, in decreasing order (starts from a). It will therefore be empty if a < b.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Monadic bind (infix version of flat_map

  • since 0.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

Infix version of map

  • since 0.5
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

Applicative operator (product+application)

  • since 0.5
val (<+>) : 'a t -> 'a t -> 'a t

Concatenation of iterators

  • since 0.5
\ No newline at end of file diff --git a/doc/iter/IterLabels/Map/Adapt/index.html b/doc/iter/IterLabels/Map/Adapt/index.html index b3f80a8..205e8b5 100644 --- a/doc/iter/IterLabels/Map/Adapt/index.html +++ b/doc/iter/IterLabels/Map/Adapt/index.html @@ -1,6 +1,6 @@ -Adapt (iter.IterLabels.Map.Adapt)

Module Map.Adapt

Adapt a pre-existing Map module to make it iterator-aware

Parameters

module M : Stdlib.Map.S

Signature

include Stdlib.Map.S with type key = M.key with type 'a t = 'a M.t
type key = M.key
type 'a t = 'a M.t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +Adapt (iter.IterLabels.Map.Adapt)

Module Map.Adapt

Adapt a pre-existing Map module to make it iterator-aware

Parameters

module M : Stdlib.Map.S

Signature

include Stdlib.Map.S with type key = M.key with type 'a t = 'a M.t
type key = M.key
type 'a t = 'a M.t
val empty : 'a t
val add : key -> 'a -> 'a t -> 'a t
val add_to_list : key -> 'a -> 'a list t -> 'a list t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> - 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file + 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val split : key -> 'a t -> 'a t * 'a option * 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file diff --git a/doc/iter/IterLabels/Map/Make/index.html b/doc/iter/IterLabels/Map/Make/index.html index c62c314..515f469 100644 --- a/doc/iter/IterLabels/Map/Make/index.html +++ b/doc/iter/IterLabels/Map/Make/index.html @@ -1,6 +1,6 @@ -Make (iter.IterLabels.Map.Make)

Module Map.Make

Create an enriched Map module, with iterator-aware functions

Parameters

module V : Stdlib.Map.OrderedType

Signature

include Stdlib.Map.S with type key = V.t
type key = V.t
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +Make (iter.IterLabels.Map.Make)

Module Map.Make

Create an enriched Map module, with iterator-aware functions

Parameters

module V : Stdlib.Map.OrderedType

Signature

include Stdlib.Map.S with type key = V.t
type key = V.t
type !+'a t
val empty : 'a t
val add : key -> 'a -> 'a t -> 'a t
val add_to_list : key -> 'a -> 'a list t -> 'a list t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> - 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file + 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val split : key -> 'a t -> 'a t * 'a option * 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file diff --git a/doc/iter/IterLabels/Map/index.html b/doc/iter/IterLabels/Map/index.html index a884be8..4147235 100644 --- a/doc/iter/IterLabels/Map/index.html +++ b/doc/iter/IterLabels/Map/index.html @@ -1,4 +1,4 @@ -Map (iter.IterLabels.Map)

Module IterLabels.Map

module type S = sig ... end
module Adapt +Map (iter.IterLabels.Map)

Module IterLabels.Map

module type S = sig ... end
module Adapt (M : Stdlib.Map.S) : S with type key = M.key and type 'a t = 'a M.t

Adapt a pre-existing Map module to make it iterator-aware

module Make (V : Stdlib.Map.OrderedType) : S with type key = V.t

Create an enriched Map module, with iterator-aware functions

\ No newline at end of file diff --git a/doc/iter/IterLabels/Map/module-type-S/index.html b/doc/iter/IterLabels/Map/module-type-S/index.html index d5fe52c..e816813 100644 --- a/doc/iter/IterLabels/Map/module-type-S/index.html +++ b/doc/iter/IterLabels/Map/module-type-S/index.html @@ -1,6 +1,6 @@ -S (iter.IterLabels.Map.S)

Module type Map.S

include Stdlib.Map.S
type key
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : +S (iter.IterLabels.Map.S)

Module type Map.S

include Stdlib.Map.S
type key
type !+'a t
val empty : 'a t
val add : key -> 'a -> 'a t -> 'a t
val add_to_list : key -> 'a -> 'a list t -> 'a list t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> - 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file + 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val split : key -> 'a t -> 'a t * 'a option * 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val to_iter : 'a t -> (key * 'a) iter
val of_iter : (key * 'a) iter -> 'a t
val keys : 'a t -> key iter
val values : 'a t -> 'a iter
val to_list : 'a t -> (key * 'a) list
val of_list : (key * 'a) list -> 'a t
val to_seq : 'a t -> (key * 'a) iter
val of_seq : (key * 'a) iter -> 'a t
\ No newline at end of file diff --git a/doc/iter/IterLabels/Set/Adapt/index.html b/doc/iter/IterLabels/Set/Adapt/index.html index 1be6d2c..c12351f 100644 --- a/doc/iter/IterLabels/Set/Adapt/index.html +++ b/doc/iter/IterLabels/Set/Adapt/index.html @@ -1,2 +1,2 @@ -Adapt (iter.IterLabels.Set.Adapt)

Module Set.Adapt

Create an enriched Set module from the given one

Parameters

module X : Stdlib.Set.S

Signature

include Stdlib.Set.S with type elt = X.elt with type t = X.t
type elt = X.elt
type t = X.t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file +Adapt (iter.IterLabels.Set.Adapt)

Module Set.Adapt

Create an enriched Set module from the given one

Parameters

module X : Stdlib.Set.S

Signature

include Stdlib.Set.S with type elt = X.elt with type t = X.t
type elt = X.elt
type t = X.t
val empty : t
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val map : (elt -> elt) -> t -> t
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val is_empty : t -> bool
val mem : elt -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val subset : t -> t -> bool
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file diff --git a/doc/iter/IterLabels/Set/Make/index.html b/doc/iter/IterLabels/Set/Make/index.html index 4ef0eda..74252e2 100644 --- a/doc/iter/IterLabels/Set/Make/index.html +++ b/doc/iter/IterLabels/Set/Make/index.html @@ -1,2 +1,2 @@ -Make (iter.IterLabels.Set.Make)

Module Set.Make

Functor to build an extended Set module from an ordered type

Parameters

module X : Stdlib.Set.OrderedType

Signature

include Stdlib.Set.S with type elt = X.t
type elt = X.t
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file +Make (iter.IterLabels.Set.Make)

Module Set.Make

Functor to build an extended Set module from an ordered type

Parameters

module X : Stdlib.Set.OrderedType

Signature

include Stdlib.Set.S with type elt = X.t
type elt = X.t
type t
val empty : t
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val map : (elt -> elt) -> t -> t
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val is_empty : t -> bool
val mem : elt -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val subset : t -> t -> bool
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file diff --git a/doc/iter/IterLabels/Set/index.html b/doc/iter/IterLabels/Set/index.html index e0f55f2..bd44344 100644 --- a/doc/iter/IterLabels/Set/index.html +++ b/doc/iter/IterLabels/Set/index.html @@ -1,2 +1,2 @@ -Set (iter.IterLabels.Set)

Module IterLabels.Set

module type S = sig ... end
module Adapt (X : Stdlib.Set.S) : S with type elt = X.elt and type t = X.t

Create an enriched Set module from the given one

module Make (X : Stdlib.Set.OrderedType) : S with type elt = X.t

Functor to build an extended Set module from an ordered type

\ No newline at end of file +Set (iter.IterLabels.Set)

Module IterLabels.Set

module type S = sig ... end
module Adapt (X : Stdlib.Set.S) : S with type elt = X.elt and type t = X.t

Create an enriched Set module from the given one

module Make (X : Stdlib.Set.OrderedType) : S with type elt = X.t

Functor to build an extended Set module from an ordered type

\ No newline at end of file diff --git a/doc/iter/IterLabels/Set/module-type-S/index.html b/doc/iter/IterLabels/Set/module-type-S/index.html index 5f842c2..b8e56e3 100644 --- a/doc/iter/IterLabels/Set/module-type-S/index.html +++ b/doc/iter/IterLabels/Set/module-type-S/index.html @@ -1,2 +1,2 @@ -S (iter.IterLabels.Set.S)

Module type Set.S

include Stdlib.Set.S
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file +S (iter.IterLabels.Set.S)

Module type Set.S

include Stdlib.Set.S
type elt
type t
val empty : t
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val diff : t -> t -> t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val map : (elt -> elt) -> t -> t
val filter : (elt -> bool) -> t -> t
val filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val is_empty : t -> bool
val mem : elt -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val subset : t -> t -> bool
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_iter : elt iter -> t
val to_iter : t -> elt iter
val to_list : t -> elt list
val of_list : elt list -> t
val of_seq : elt iter -> t
val to_seq : t -> elt iter
\ No newline at end of file diff --git a/doc/iter/IterLabels/index.html b/doc/iter/IterLabels/index.html index 89fbf11..f6cbdcb 100644 --- a/doc/iter/IterLabels/index.html +++ b/doc/iter/IterLabels/index.html @@ -1,5 +1,5 @@ -IterLabels (iter.IterLabels)

Module IterLabels

Simple and Efficient Iterators

Version of Iterator with labels

  • since 0.5.5
type +'a t = ('a -> unit) -> unit

An iterator of values of type 'a. If you give it a function 'a -> unit it will be applied to every element of the iterator successively.

type +'a iter = 'a t

NOTE Type ('a, 'b) t2 = ('a -> 'b -> unit) -> unit has been removed and subsumed by ('a * 'b) t

  • since 1.0
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int

Creation

val from_iter : (('a -> unit) -> unit) -> 'a t

Build an iterator from a iter function

val from_labelled_iter : (f:('a -> unit) -> unit) -> 'a t

Build an iterator from a labelled iter function

  • since 1.2
val from_fun : (unit -> 'a option) -> 'a t

Call the function repeatedly until it returns None. This iterator is transient, use persistent if needed!

val empty : 'a t

Empty iterator. It contains no element.

val singleton : 'a -> 'a t

Singleton iterator, with exactly one element.

val doubleton : 'a -> 'a -> 'a t

Iterator with exactly two elements

val init : f:(int -> 'a) -> 'a t

init f is the infinite iterator f 0; f 1; f 2; ….

  • since 0.9
val cons : 'a -> 'a t -> 'a t

cons x l yields x, then yields from l. Same as append (singleton x) l

val snoc : 'a t -> 'a -> 'a t

Same as cons but yields the element after iterating on l

val return : 'a -> 'a t

Synonym to singleton

val pure : 'a -> 'a t

Synonym to singleton

val repeat : 'a -> 'a t

Infinite iterator of the same element. You may want to look at take and the likes if you iterate on it.

val iterate : ('a -> 'a) -> 'a -> 'a t

iterate f x is the infinite iterator x, f(x), f(f(x)), ...

val forever : (unit -> 'b) -> 'b t

Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.

val cycle : 'a t -> 'a t

Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.

Consumption

val iter : f:('a -> unit) -> 'a t -> unit

Consume the iterator, passing all its arguments to the function. Basically iter f seq is just seq f.

val iteri : f:(int -> 'a -> unit) -> 'a t -> unit

Iterate on elements and their index in the iterator

val for_each : seq:'a t -> ('a -> unit) -> unit

Consume the iterator, passing all its arguments to the function. for_each seq f is the same as iter f seq, i.e., iter with arguments reversed.

  • since 1.4
val for_eachi : seq:'a t -> (int -> 'a -> unit) -> unit

Iterate on elements and their index in the iterator. for_eachi seq f is the same as iteri f seq, i.e., iteri with arguments reversed.

  • since 1.4
val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'a

Fold over elements of the iterator, consuming it

val foldi : f:('a -> int -> 'b -> 'a) -> init:'a -> 'b t -> 'a

Fold over elements of the iterator and their index, consuming it

val fold_map : f:('acc -> 'a -> 'acc * 'b) -> init:'acc -> 'a t -> 'b t

fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.

  • since 0.9
val fold_filter_map : +IterLabels (iter.IterLabels)

Module IterLabels

Simple and Efficient Iterators

Version of Iterator with labels

  • since 0.5.5
type +'a t = ('a -> unit) -> unit

An iterator of values of type 'a. If you give it a function 'a -> unit it will be applied to every element of the iterator successively.

type +'a iter = 'a t

NOTE Type ('a, 'b) t2 = ('a -> 'b -> unit) -> unit has been removed and subsumed by ('a * 'b) t

  • since 1.0
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int

Creation

val from_iter : (('a -> unit) -> unit) -> 'a t

Build an iterator from a iter function

val from_labelled_iter : (f:('a -> unit) -> unit) -> 'a t

Build an iterator from a labelled iter function

  • since 1.2
val from_fun : (unit -> 'a option) -> 'a t

Call the function repeatedly until it returns None. This iterator is transient, use persistent if needed!

val empty : 'a t

Empty iterator. It contains no element.

val singleton : 'a -> 'a t

Singleton iterator, with exactly one element.

val doubleton : 'a -> 'a -> 'a t

Iterator with exactly two elements

val init : f:(int -> 'a) -> 'a t

init f is the infinite iterator f 0; f 1; f 2; ….

  • since 0.9
val cons : 'a -> 'a t -> 'a t

cons x l yields x, then yields from l. Same as append (singleton x) l

val snoc : 'a t -> 'a -> 'a t

Same as cons but yields the element after iterating on l

val return : 'a -> 'a t

Synonym to singleton

val pure : 'a -> 'a t

Synonym to singleton

val repeat : 'a -> 'a t

Infinite iterator of the same element. You may want to look at take and the likes if you iterate on it.

val iterate : ('a -> 'a) -> 'a -> 'a t

iterate f x is the infinite iterator x, f(x), f(f(x)), ...

val forever : (unit -> 'b) -> 'b t

Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.

val cycle : 'a t -> 'a t

Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.

Consumption

val iter : f:('a -> unit) -> 'a t -> unit

Consume the iterator, passing all its arguments to the function. Basically iter f seq is just seq f.

val iteri : f:(int -> 'a -> unit) -> 'a t -> unit

Iterate on elements and their index in the iterator

val for_each : seq:'a t -> ('a -> unit) -> unit

Consume the iterator, passing all its arguments to the function. for_each seq f is the same as iter f seq, i.e., iter with arguments reversed.

  • since 1.4
val for_eachi : seq:'a t -> (int -> 'a -> unit) -> unit

Iterate on elements and their index in the iterator. for_eachi seq f is the same as iteri f seq, i.e., iteri with arguments reversed.

  • since 1.4
val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'a

Fold over elements of the iterator, consuming it

val foldi : f:('a -> int -> 'b -> 'a) -> init:'a -> 'b t -> 'a

Fold over elements of the iterator and their index, consuming it

val fold_map : f:('acc -> 'a -> 'acc * 'b) -> init:'acc -> 'a t -> 'b t

fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.

  • since 0.9
val fold_filter_map : f:('acc -> 'a -> 'acc * 'b option) -> init:'acc -> 'a t -> diff --git a/doc/iter/index.html b/doc/iter/index.html index 0b4aa8a..776984d 100644 --- a/doc/iter/index.html +++ b/doc/iter/index.html @@ -1,2 +1,2 @@ -index (iter.index)

iter index

Library iter

This library exposes the following toplevel modules:

Library iter.bigarray

The entry point of this library is the module: IterBigarray.

\ No newline at end of file +index (iter.index)

iter index

Library iter

This library exposes the following toplevel modules:

Library iter.bigarray

The entry point of this library is the module: IterBigarray.

\ No newline at end of file diff --git a/doc/_odoc_support/fonts/KaTeX_AMS-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_AMS-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_AMS-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_AMS-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Caligraphic-Bold.woff2 b/doc/odoc.support/fonts/KaTeX_Caligraphic-Bold.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Caligraphic-Bold.woff2 rename to doc/odoc.support/fonts/KaTeX_Caligraphic-Bold.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Caligraphic-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Caligraphic-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Caligraphic-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Caligraphic-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Fraktur-Bold.woff2 b/doc/odoc.support/fonts/KaTeX_Fraktur-Bold.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Fraktur-Bold.woff2 rename to doc/odoc.support/fonts/KaTeX_Fraktur-Bold.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Fraktur-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Fraktur-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Fraktur-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Fraktur-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Main-Bold.woff2 b/doc/odoc.support/fonts/KaTeX_Main-Bold.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Main-Bold.woff2 rename to doc/odoc.support/fonts/KaTeX_Main-Bold.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Main-BoldItalic.woff2 b/doc/odoc.support/fonts/KaTeX_Main-BoldItalic.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Main-BoldItalic.woff2 rename to doc/odoc.support/fonts/KaTeX_Main-BoldItalic.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Main-Italic.woff2 b/doc/odoc.support/fonts/KaTeX_Main-Italic.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Main-Italic.woff2 rename to doc/odoc.support/fonts/KaTeX_Main-Italic.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Main-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Main-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Main-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Main-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Math-BoldItalic.woff2 b/doc/odoc.support/fonts/KaTeX_Math-BoldItalic.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Math-BoldItalic.woff2 rename to doc/odoc.support/fonts/KaTeX_Math-BoldItalic.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Math-Italic.woff2 b/doc/odoc.support/fonts/KaTeX_Math-Italic.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Math-Italic.woff2 rename to doc/odoc.support/fonts/KaTeX_Math-Italic.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_SansSerif-Bold.woff2 b/doc/odoc.support/fonts/KaTeX_SansSerif-Bold.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_SansSerif-Bold.woff2 rename to doc/odoc.support/fonts/KaTeX_SansSerif-Bold.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_SansSerif-Italic.woff2 b/doc/odoc.support/fonts/KaTeX_SansSerif-Italic.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_SansSerif-Italic.woff2 rename to doc/odoc.support/fonts/KaTeX_SansSerif-Italic.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_SansSerif-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_SansSerif-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_SansSerif-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_SansSerif-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Script-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Script-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Script-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Script-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Size1-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Size1-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Size1-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Size1-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Size2-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Size2-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Size2-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Size2-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Size3-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Size3-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Size3-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Size3-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Size4-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Size4-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Size4-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Size4-Regular.woff2 diff --git a/doc/_odoc_support/fonts/KaTeX_Typewriter-Regular.woff2 b/doc/odoc.support/fonts/KaTeX_Typewriter-Regular.woff2 similarity index 100% rename from doc/_odoc_support/fonts/KaTeX_Typewriter-Regular.woff2 rename to doc/odoc.support/fonts/KaTeX_Typewriter-Regular.woff2 diff --git a/doc/_odoc_support/highlight.pack.js b/doc/odoc.support/highlight.pack.js similarity index 100% rename from doc/_odoc_support/highlight.pack.js rename to doc/odoc.support/highlight.pack.js diff --git a/doc/_odoc_support/katex.min.css b/doc/odoc.support/katex.min.css similarity index 100% rename from doc/_odoc_support/katex.min.css rename to doc/odoc.support/katex.min.css diff --git a/doc/_odoc_support/katex.min.js b/doc/odoc.support/katex.min.js similarity index 100% rename from doc/_odoc_support/katex.min.js rename to doc/odoc.support/katex.min.js diff --git a/doc/_odoc_support/odoc.css b/doc/odoc.support/odoc.css similarity index 100% rename from doc/_odoc_support/odoc.css rename to doc/odoc.support/odoc.css