mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-05 19:00:31 -05:00
readme
This commit is contained in:
parent
5227fb975c
commit
24fdfdf3ee
1 changed files with 6 additions and 3 deletions
|
|
@ -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`
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue