mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
prepare for 0.13
This commit is contained in:
parent
f56a40b753
commit
044cbf0c20
32 changed files with 160 additions and 98 deletions
|
|
@ -1,5 +1,67 @@
|
|||
= Changelog
|
||||
|
||||
== 0.13
|
||||
|
||||
=== Breaking changes
|
||||
|
||||
- big refactoring of `CCLinq` (now simpler and cleaner)
|
||||
- changed the types `input` and `ParseError` in `CCParse`
|
||||
- move `containers.misc` and `containers.lwt` into their own repo
|
||||
- change the exceptions in `CCVector`
|
||||
- change signature of `CCDeque.of_seq`
|
||||
|
||||
=== Other changes
|
||||
|
||||
- add module `CCWBTree`, a weight-balanced tree, in `containers.data`.
|
||||
- add module `CCBloom` in `containers.data`, a bloom filter
|
||||
- new module `CCHashTrie` in `containers.data`, HAMT-like associative map
|
||||
- add module `CCBitField` in `containers.data`, a safe abstraction for bitfields of < 62 bits
|
||||
- add module `CCHashSet` into `containers.data`, a mutable set
|
||||
- add module `CCInt64`
|
||||
- move module `RAL` into `containers.data` as `CCRAL`
|
||||
- new module `CCThread` in `containers.thread`, utils for threading (+ blocking queue)
|
||||
- new module `CCSemaphore` in `containers.thread`, with simple semaphore
|
||||
- add `containers.top`, a small library that installs printers
|
||||
|
||||
- add `CCParse.memo` for memoization (changes `CCParse.input`)
|
||||
- add `CCString.compare_versions`
|
||||
- update `CCHash` with a functor and module type for generic hashing
|
||||
- add `CCList.{take,drop}_while`; improve map performance
|
||||
- add `CCList.cons_maybe`
|
||||
- add `CCArray.bsearch` (back from batteries)
|
||||
- add fair functions to `CCKList`
|
||||
- deprecate `CCList.split`, introduce `CCList.take_drop` instead.
|
||||
- add `CCKtree.force`
|
||||
- add tests to `CCIntMap`; now flagged "stable" (for the API)
|
||||
- add `CCOpt.choice_seq`
|
||||
- add `CCOpt.print`
|
||||
- add `CCIntMap.{equal,compare,{of,to,add}_{gen,klist}}`
|
||||
- add `CCThread.Barrier` for simple synchronization
|
||||
- add `CCPersistentArray.{append,flatten,flat_map,of_gen,to_gen}`
|
||||
- add `CCDeque.clear`
|
||||
- add `CCDeque.{fold,append_{front,back},{of,to}_{gen,list}}` and others
|
||||
- add `CCKList.{zip, unzip}`
|
||||
- add `CCKList.{of_array,to_array}`
|
||||
- add `CCKList.{head,tail,mapi,iteri}`
|
||||
- add `CCKList.{unfold,of_gen}`
|
||||
- add `CCParse.{input_of_chan,parse_file,parse_file_exn}`
|
||||
- modify `CCParse.U.list` to skip newlines
|
||||
- add `CCDeque.print`
|
||||
- add `CCBV.print`
|
||||
- add printer to `CCHashtbl`
|
||||
|
||||
- bugfix in `CCSexpM`
|
||||
- new tests in `CCTrie`; bugfix in `CCTrie.below`
|
||||
- lots of new tests
|
||||
- more benchmarks; cleanup of benchmarks
|
||||
- migration of tests to 100% qtest
|
||||
- migration markdown to asciidoc for doc (readme, etc.)
|
||||
- add tests to `CCIntMap`, add type safety, and fix various bugs in `{union,inter}`
|
||||
- more efficient `CCThread.Queue.{push,take}_list`
|
||||
- slightly different implem for `CCThread.Queue.{take,push}`
|
||||
- new implementation for `CCDeque`, more efficient
|
||||
- update makefile (target devel)
|
||||
|
||||
== 0.12
|
||||
|
||||
=== breaking
|
||||
|
|
|
|||
2
_oasis
2
_oasis
|
|
@ -1,6 +1,6 @@
|
|||
OASISFormat: 0.4
|
||||
Name: containers
|
||||
Version: 0.12
|
||||
Version: 0.13
|
||||
Homepage: https://github.com/c-cube/ocaml-containers
|
||||
Authors: Simon Cruanes
|
||||
License: BSD-2-clause
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ val empty : 'a t
|
|||
|
||||
val start : 'a -> 'a t
|
||||
(** Start with a single value
|
||||
@deprecated since NEXT_RELEASE, use {!return} instead *)
|
||||
@deprecated since 0.13, use {!return} instead *)
|
||||
|
||||
val return : 'a -> 'a t
|
||||
(** Return one value *)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ val to_seq_slice : t -> int -> int -> char sequence
|
|||
val to_gen_slice : t -> int -> int -> char gen
|
||||
|
||||
val print : t printer
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
(** {2 Memory-map} *)
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ module type S = sig
|
|||
- [`Empty] if the array is empty
|
||||
|
||||
@raise Invalid_argument if the array is found to be unsorted w.r.t [cmp]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val for_all : ('a -> bool) -> 'a t -> bool
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ module type S = sig
|
|||
- [`Empty] if the array is empty
|
||||
|
||||
@raise Invalid_argument if the array is found to be unsorted w.r.t [cmp]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val for_all : ('a -> bool) -> 'a t -> bool
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ val apply : 'a hash_fun -> 'a -> int
|
|||
|
||||
(** {2 Basic Combinators}
|
||||
|
||||
Those combinators have been renamed in NEXT_RELEASE, so as to
|
||||
Those combinators have been renamed in 0.13, so as to
|
||||
remove the trailing "_".
|
||||
They are now defined by the application of {!Make}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ val klist : 'a hash_fun -> 'a klist hash_fun
|
|||
This can for instance be used for cryptographic hashing or
|
||||
checksums such as MD5.
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
module type HASH = sig
|
||||
type state
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ val of_list : ('a * 'b) list -> ('a,'b) Hashtbl.t
|
|||
|
||||
val print : 'a printer -> 'b printer -> ('a, 'b) Hashtbl.t printer
|
||||
(** Printer for table
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Functor} *)
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ module type S = sig
|
|||
|
||||
val print : key printer -> 'a printer -> 'a t printer
|
||||
(** Printer for tables
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
end
|
||||
|
||||
module Make(X : Hashtbl.HashedType) :
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ val pp : t printer
|
|||
val print : t formatter
|
||||
|
||||
val to_string : t -> string
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val of_string : string -> t option
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
Helpers for in64.
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
type t = int64
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ val append : 'a t -> 'a t -> 'a t
|
|||
val cons_maybe : 'a option -> 'a t -> 'a t
|
||||
(** [cons_maybe (Some x) l] is [x :: l]
|
||||
[cons_maybe None l] is [l]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val (@) : 'a t -> 'a t -> 'a t
|
||||
|
||||
|
|
@ -119,14 +119,14 @@ val take_drop : int -> 'a t -> 'a t * 'a t
|
|||
[length l1 = min (length l) n] *)
|
||||
|
||||
val take_while : ('a -> bool) -> 'a t -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val drop_while : ('a -> bool) -> 'a t -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val split : int -> 'a t -> 'a t * 'a t
|
||||
(** synonym to {!take_drop}
|
||||
@deprecated since NEXT_RELEASE: conflict with the {!List.split} standard function *)
|
||||
@deprecated since 0.13: conflict with the {!List.split} standard function *)
|
||||
|
||||
val last : int -> 'a t -> 'a t
|
||||
(** [last n l] takes the last [n] elements of [l] (or less if
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ val random : 'a random_gen -> 'a t random_gen
|
|||
val choice_seq : 'a t sequence -> 'a t
|
||||
(** [choice_seq s] is similar to {!choice}, but works on sequences.
|
||||
It returns the first [Some x] occurring in [s], or [None] otherwise.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_gen : 'a t -> 'a gen
|
||||
val to_seq : 'a t -> 'a sequence
|
||||
|
|
@ -137,5 +137,5 @@ val to_seq : 'a t -> 'a sequence
|
|||
val pp : 'a printer -> 'a t printer
|
||||
|
||||
val print : 'a fmt -> 'a t fmt
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ end
|
|||
val compare_versions : string -> string -> int
|
||||
(** [compare_versions a b] compares {i version strings} [a] and [b],
|
||||
considering that numbers are above text.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(*$T
|
||||
compare_versions "0.1.3" "0.1" > 0
|
||||
|
|
|
|||
|
|
@ -92,4 +92,4 @@ end
|
|||
module Vector = CCVector
|
||||
|
||||
module Int64 = CCInt64
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
|
|
|||
|
|
@ -123,4 +123,4 @@ val of_seq : int sequence -> t
|
|||
|
||||
val print : Format.formatter -> t -> unit
|
||||
(** Print the bitvector as a string of bits
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Format.printf "f: %a@." B.pp f;;
|
|||
|
||||
{b status: experimental}
|
||||
|
||||
@since NEXT_RELEASE
|
||||
@since 0.13
|
||||
*)
|
||||
|
||||
exception TooManyFields
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
{b status: experimental}
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
type 'a sequence = ('a -> unit) -> unit
|
||||
type 'a gen = unit -> 'a option
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ val create : unit -> 'a t
|
|||
|
||||
val clear : _ t -> unit
|
||||
(** Remove all elements
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val is_empty : 'a t -> bool
|
||||
(** Is the deque empty? *)
|
||||
|
|
@ -44,12 +44,12 @@ val equal : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
|||
(** [equal a b] checks whether [a] and [b] contain the same sequence of
|
||||
elements.
|
||||
@param eq comparison function for elements
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val compare : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t -> int
|
||||
(** [equal a b] compares lexicographically [a] and [b]
|
||||
@param cmp comparison function for elements
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val length : 'a t -> int
|
||||
(** Number of elements
|
||||
|
|
@ -76,18 +76,18 @@ val take_front : 'a t -> 'a
|
|||
val append_front : into:'a t -> 'a t -> unit
|
||||
(** [append_front ~into q] adds all elements of [q] at the front
|
||||
of [into]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val append_back : into:'a t -> 'a t -> unit
|
||||
(** [append_back ~into q] adds all elements of [q] at the back of [into]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val iter : ('a -> unit) -> 'a t -> unit
|
||||
(** Iterate on elements *)
|
||||
|
||||
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
|
||||
(** Fold on elements
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Conversions} *)
|
||||
|
||||
|
|
@ -96,44 +96,44 @@ type 'a sequence = ('a -> unit) -> unit
|
|||
|
||||
val of_seq : 'a sequence -> 'a t
|
||||
(** Create a deque from the sequence.
|
||||
@since NEXT_RELEASE optional argument [deque] disappears, use
|
||||
@since 0.13 optional argument [deque] disappears, use
|
||||
{!add_seq_back} instead *)
|
||||
|
||||
val to_seq : 'a t -> 'a sequence
|
||||
|
||||
val of_gen : 'a gen -> 'a t
|
||||
(** [of_gen g] makes a deque containing the elements of [g]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_gen : 'a t -> 'a gen
|
||||
(** Iterates on elements of the deque
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val add_seq_front : 'a t -> 'a sequence -> unit
|
||||
(** [add_seq_front q seq] adds elements of [seq] into the front of [q],
|
||||
in reverse order
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val add_seq_back : 'a t -> 'a sequence -> unit
|
||||
(** [add_seq_back q seq] adds elements of [seq] into the back of [q],
|
||||
in order
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val copy : 'a t -> 'a t
|
||||
(** Fresh copy *)
|
||||
|
||||
val of_list : 'a list -> 'a t
|
||||
(** Conversion from list, in order
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_list : 'a t -> 'a list
|
||||
(** List of elements, in order
|
||||
{b warning: not tailrec}
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_rev_list : 'a t -> 'a list
|
||||
(** Efficient conversion to list, in reverse order
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 print} *)
|
||||
|
||||
|
|
@ -141,4 +141,4 @@ type 'a printer = Format.formatter -> 'a -> unit
|
|||
|
||||
val print : 'a printer -> 'a t printer
|
||||
(** Print the elements
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
|
|
|||
|
|
@ -150,4 +150,4 @@ val (--) : int -> int -> int t
|
|||
@since 0.10 *)
|
||||
|
||||
val print : 'a printer -> 'a t printer
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{b status: unstable}
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
type 'a sequence = ('a -> unit) -> unit
|
||||
type 'a printer = Format.formatter -> 'a -> unit
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
{b status: unstable}
|
||||
|
||||
@since NEXT_RELEASE
|
||||
@since 0.13
|
||||
*)
|
||||
|
||||
type 'a sequence = ('a -> unit) -> unit
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ val remove : int -> 'a t -> 'a t
|
|||
val equal : eq:('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
||||
(** [equal ~eq a b] checks whether [a] and [b] have the same set of pairs
|
||||
(key, value), comparing values with [eq]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val compare : cmp:('a -> 'a -> int) -> 'a t -> 'a t -> int
|
||||
(** Total order between maps; the precise order is unspecified .
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val update : int -> ('a option -> 'a option) -> 'a t -> 'a t
|
||||
|
||||
|
|
@ -99,22 +99,22 @@ val keys : _ t -> int sequence
|
|||
val values : 'a t -> 'a sequence
|
||||
|
||||
val add_gen : 'a t -> (int * 'a) gen -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val of_gen : (int * 'a) gen -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val to_gen : 'a t -> (int * 'a) gen
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val add_klist : 'a t -> (int * 'a) klist -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val of_klist : (int * 'a) klist -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val to_klist : 'a t -> (int * 'a) klist
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
type 'a tree = unit -> [`Nil | `Node of 'a * 'a tree list]
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ val as_tree : 'a t -> [`Node of int * int | `Leaf of int * 'a ] tree
|
|||
type 'a printer = Format.formatter -> 'a -> unit
|
||||
|
||||
val print : 'a printer -> 'a t printer
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
(** Helpers *)
|
||||
|
||||
|
|
|
|||
|
|
@ -86,15 +86,15 @@ val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
|
|||
|
||||
val append : 'a t -> 'a t -> 'a t
|
||||
(** Append the two arrays
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val flatten : 'a t t -> 'a t
|
||||
(** Concatenates all the sub-arrays
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val flat_map : ('a -> 'b t) -> 'a t -> 'b t
|
||||
(** Flat map (map + concatenation)
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_array : 'a t -> 'a array
|
||||
(** [to_array t] returns a mutable copy of [t]. *)
|
||||
|
|
@ -110,7 +110,7 @@ val of_list : 'a list -> 'a t
|
|||
|
||||
val of_rev_list : 'a list -> 'a t
|
||||
(** [of_rev_list l] is the same as [of_list (List.rev l)] but more efficient
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Conversions} *)
|
||||
|
||||
|
|
@ -122,15 +122,15 @@ val to_seq : 'a t -> 'a sequence
|
|||
val of_seq : 'a sequence -> 'a t
|
||||
|
||||
val of_gen : 'a gen -> 'a t
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
val to_gen : 'a t -> 'a gen
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
(** {2 IO} *)
|
||||
|
||||
type 'a printer = Format.formatter -> 'a -> unit
|
||||
|
||||
val print : 'a printer -> 'a t printer
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
{b status: stable}
|
||||
|
||||
@since NEXT_RELEASE
|
||||
@since 0.13
|
||||
*)
|
||||
|
||||
type +'a t
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
{b status: experimental}
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
type 'a sequence = ('a -> unit) -> unit
|
||||
type 'a gen = unit -> 'a option
|
||||
|
|
|
|||
|
|
@ -60,27 +60,27 @@ val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t
|
|||
(** [unfold f acc] calls [f acc] and:
|
||||
- if [f acc = Some (x, acc')], yield [x], continue with [unfold f acc']
|
||||
- if [f acc = None], stops
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val is_empty : 'a t -> bool
|
||||
|
||||
val head : 'a t -> 'a option
|
||||
(** Head of the list
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val head_exn : 'a t -> 'a
|
||||
(** Unsafe version of {!head}
|
||||
@raise Not_found if the list is empty
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val tail : 'a t -> 'a t option
|
||||
(** Tail of the list
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val tail_exn : 'a t -> 'a t
|
||||
(** Unsafe version of {!tail}
|
||||
@raise Not_found if the list is empty
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val equal : 'a equal -> 'a t equal
|
||||
(** Equality step by step. Eager. *)
|
||||
|
|
@ -95,7 +95,7 @@ val iter : ('a -> unit) -> 'a t -> unit
|
|||
|
||||
val iteri : (int -> 'a -> unit) -> 'a t -> unit
|
||||
(** Iterate with index (starts at 0)
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val length : _ t -> int
|
||||
(** Number of elements in the list.
|
||||
|
|
@ -114,7 +114,7 @@ val map : ('a -> 'b) -> 'a t -> 'b t
|
|||
|
||||
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
|
||||
(** Map with index (starts at 0)
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val fmap : ('a -> 'b option) -> 'a t -> 'b t
|
||||
|
||||
|
|
@ -173,11 +173,11 @@ val merge : 'a ord -> 'a t -> 'a t -> 'a t
|
|||
|
||||
val zip : 'a t -> 'b t -> ('a * 'b) t
|
||||
(** Combine elements pairwise. Stops as soon as one of the lists stops.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val unzip : ('a * 'b) t -> 'a t * 'b t
|
||||
(** Splits each tuple in the list
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Misc} *)
|
||||
|
||||
|
|
@ -195,15 +195,15 @@ val sort_uniq : ?cmp:'a ord -> 'a t -> 'a t
|
|||
|
||||
val interleave : 'a t -> 'a t -> 'a t
|
||||
(** Fair interleaving of both streams.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val fair_flat_map : ('a -> 'b t) -> 'a t -> 'b t
|
||||
(** Fair version of {!flat_map}.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val fair_app : ('a -> 'b) t -> 'a t -> 'b t
|
||||
(** Fair version of {!(<*>)}
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Implementations}
|
||||
@since 0.3.3 *)
|
||||
|
|
@ -216,11 +216,11 @@ val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
|
|||
|
||||
val (>>-) : 'a t -> ('a -> 'b t) -> 'b t
|
||||
(** Infix version of {! fair_flat_map}
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val (<.>) : ('a -> 'b) t -> 'a t -> 'b t
|
||||
(** Infix version of {!fair_app}
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Monadic Operations} *)
|
||||
module type MONAD = sig
|
||||
|
|
@ -246,11 +246,11 @@ val to_list : 'a t -> 'a list
|
|||
|
||||
val of_array : 'a array -> 'a t
|
||||
(** Iterate on the array
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_array : 'a t -> 'a array
|
||||
(** Convert into array. Iterates twice.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val to_rev_list : 'a t -> 'a list
|
||||
(** Convert to a list, in reverse order. More efficient than {!to_list} *)
|
||||
|
|
@ -261,7 +261,7 @@ val to_gen : 'a t -> 'a gen
|
|||
|
||||
val of_gen : 'a gen -> 'a t
|
||||
(** [of_gen g] consumes the generator and caches intermediate results
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 IO} *)
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ val bfs : ?pset:'a pset -> 'a t -> 'a klist
|
|||
val force : 'a t -> ([ `Nil | `Node of 'a * 'b list ] as 'b)
|
||||
(** [force t] evaluates [t] completely and returns a regular tree
|
||||
structure
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val find : ?pset:'a pset -> ('a -> 'b option) -> 'a t -> 'b option
|
||||
(** Look for an element that maps to [Some _] *)
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ type input = {
|
|||
cur : unit -> char; (** Current char *)
|
||||
next : unit -> char; (** if not {!is_done}, move to next char *)
|
||||
pos : unit -> int; (** Current pos *)
|
||||
lnum : unit -> line_num; (** Line number @since NEXT_RELEASE *)
|
||||
cnum : unit -> col_num; (** column number @since NEXT_RELEASE *)
|
||||
lnum : unit -> line_num; (** Line number @since 0.13 *)
|
||||
cnum : unit -> col_num; (** column number @since 0.13 *)
|
||||
memo : memo_; (** memoization table, if any *)
|
||||
backtrack : int -> unit; (** Restore to previous pos *)
|
||||
sub : int -> int -> string; (** Extract slice from [pos] with [len] *)
|
||||
|
|
|
|||
|
|
@ -64,17 +64,17 @@ parse_string_exn "[abc , de, hello ,world ]" p;;
|
|||
|
||||
type 'a or_error = [`Ok of 'a | `Error of string]
|
||||
|
||||
type line_num = int (** @since NEXT_RELEASE *)
|
||||
type col_num = int (** @since NEXT_RELEASE *)
|
||||
type line_num = int (** @since 0.13 *)
|
||||
type col_num = int (** @since 0.13 *)
|
||||
|
||||
exception ParseError of line_num * col_num * (unit -> string)
|
||||
(** position * message
|
||||
|
||||
This type changed at NEXT_RELEASE *)
|
||||
This type changed at 0.13 *)
|
||||
|
||||
(** {2 Input} *)
|
||||
|
||||
(** @since NEXT_RELEASE *)
|
||||
(** @since 0.13 *)
|
||||
module MemoTbl : sig
|
||||
type t
|
||||
val create: int -> t (** New memoization table *)
|
||||
|
|
@ -89,8 +89,8 @@ type input = {
|
|||
otherwise throw ParseError *)
|
||||
|
||||
pos : unit -> int; (** Current pos *)
|
||||
lnum : unit -> line_num; (** Line number @since NEXT_RELEASE *)
|
||||
cnum : unit -> col_num; (** column number @since NEXT_RELEASE *)
|
||||
lnum : unit -> line_num; (** Line number @since 0.13 *)
|
||||
cnum : unit -> col_num; (** column number @since 0.13 *)
|
||||
memo : MemoTbl.t; (** memoization table, if any *)
|
||||
backtrack : int -> unit; (** Restore to previous pos *)
|
||||
sub : int -> int -> string; (** [sub pos len] extracts slice from [pos] with [len] *)
|
||||
|
|
@ -105,7 +105,7 @@ val input_of_chan : ?size:int -> in_channel -> input
|
|||
(** [input_of_chan ic] reads lazily the content of [ic] as parsing goes.
|
||||
All content that is read is saved to an internal buffer for backtracking.
|
||||
@param size number of bytes read at once from [ic]
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Combinators} *)
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ val is_space : char -> bool
|
|||
|
||||
val is_white : char -> bool
|
||||
(** True on ' ' and '\t' and '\n'
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val (~~~) : (char -> bool) -> char -> bool
|
||||
(** Negation on predicates *)
|
||||
|
|
@ -232,11 +232,11 @@ val memo : 'a t -> 'a t
|
|||
is a lot of backtracking involving [p].
|
||||
|
||||
This function is not thread-safe.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val fix_memo : ('a t -> 'a t) -> 'a t
|
||||
(** Same as {!fix}, but the fixpoint is memoized.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Parse} *)
|
||||
|
||||
|
|
@ -257,11 +257,11 @@ val parse_file : ?size:int -> file:string -> 'a t -> 'a or_error
|
|||
(** [parse_file ~file p] parses [file] with [p] by opening the file
|
||||
and using {!input_of_chan}.
|
||||
@param size size of chunks read from file
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val parse_file_exn : ?size:int -> file:string -> 'a t -> 'a
|
||||
(** Unsafe version of {!parse_file}
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
(** {2 Utils} *)
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ val with_lock : 'a t -> ('a -> 'b) -> 'b
|
|||
fails too but the lock is released *)
|
||||
|
||||
(** Type allowing to manipulate the lock as a reference
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
module LockRef : sig
|
||||
type 'a t
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ val with_lock_as_ref : 'a t -> f:('a LockRef.t -> 'b) -> 'b
|
|||
(** [with_lock_as_ref l f] calls [f] with a reference-like object
|
||||
that allows to manipulate the value of [l] safely.
|
||||
The object passed to [f] must not escape the function call
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val update : 'a t -> ('a -> 'a) -> unit
|
||||
(** [update l f] replaces the content [x] of [l] with [f x], atomically *)
|
||||
|
|
@ -69,13 +69,13 @@ val get : 'a t -> 'a
|
|||
|
||||
val set : 'a t -> 'a -> unit
|
||||
(** Atomically set the value
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val incr : int t -> unit
|
||||
(** Atomically increment the value
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
val decr : int t -> unit
|
||||
(** Atomically decrement the value
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
(** {1 Semaphores}
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
type t
|
||||
(** A semaphore *)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
(** {1 Threads}
|
||||
|
||||
{b status: unstable}
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.13 *)
|
||||
|
||||
type t = Thread.t
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue