This commit is contained in:
Simon Cruanes 2022-11-14 09:08:39 -05:00
parent 5227fb975c
commit 24fdfdf3ee
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -411,7 +411,7 @@ module IntMap = CCMap.Make(CCInt);;
```ocaml ```ocaml
# (* conversions using the "iter" type, fast iterators that are # (* conversions using the "iter" type, fast iterators that are
pervasively used in containers. Combinators can be found pervasively used in containers. Combinators can be found
in the opam library "sequence". *) in the opam library "iter". *)
let map : string IntMap.t = let map : string IntMap.t =
l2 l2
|> List.map (fun x -> x, string_of_int x) |> List.map (fun x -> x, string_of_int x)
@ -648,10 +648,13 @@ Some structural types are used throughout the library:
- `gen`: `'a gen = unit -> 'a option` is an iterator type. Many combinators - `gen`: `'a gen = unit -> 'a option` is an iterator type. Many combinators
are defined in the opam library [gen](https://github.com/c-cube/gen) are defined in the opam library [gen](https://github.com/c-cube/gen)
- `sequence`: `'a sequence = (unit -> 'a) -> unit` is also an iterator type. - `iter`: `'a iter = (unit -> 'a) -> unit` is also an iterator type, formerly
named `sequence`.
It is easier to define on data structures than `gen`, but it a bit less It is easier to define on data structures than `gen`, but it a bit less
powerful. The opam library [iter](https://github.com/c-cube/iter) powerful. The opam library [iter](https://github.com/c-cube/iter)
can be used to consume and produce values of this type. It was renamed can be used to consume and produce values of this type.
It was renamed
from `'a sequence` to `'a iter` to distinguish it better from `Core.Sequence` from `'a sequence` to `'a iter` to distinguish it better from `Core.Sequence`
and the standard `seq`. and the standard `seq`.
- `error`: `'a or_error = ('a, string) result = Error of string | Ok of 'a` - `error`: `'a or_error = ('a, string) result = Error of string | Ok of 'a`