fix @since annotations

This commit is contained in:
Simon Cruanes 2014-11-23 14:41:40 +01:00
parent 16f160678d
commit b481d919bf
5 changed files with 38 additions and 38 deletions

View file

@ -72,12 +72,12 @@ module type S = sig
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option
(** Like {!find}, but also pass the index to the predicate function. (** Like {!find}, but also pass the index to the predicate function.
@since 0.4 *) @since 0.3.4 *)
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
(** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], (** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l],
and [p x] holds. Otherwise returns [None] and [p x] holds. Otherwise returns [None]
@since 0.4 *) @since 0.3.4 *)
val lookup : ?cmp:'a ord -> 'a -> 'a t -> int option val lookup : ?cmp:'a ord -> 'a -> 'a t -> int option
(** Lookup the index of some value in a sorted array. (** Lookup the index of some value in a sorted array.

View file

@ -103,7 +103,7 @@ val find : ('a -> 'b option) -> 'a t -> 'b option
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option
(** Like {!find}, but also pass the index to the predicate function. (** Like {!find}, but also pass the index to the predicate function.
@since 0.4 *) @since 0.3.4 *)
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
(** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], (** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l],

View file

@ -67,7 +67,7 @@ val filter : ('a -> bool) -> 'a t -> 'a t
val get : 'a -> 'a t -> 'a val get : 'a -> 'a t -> 'a
(** [get default x] unwraps [x], but if [x = None] it returns [default] instead. (** [get default x] unwraps [x], but if [x = None] it returns [default] instead.
@since 0.5 *) @since 0.4.1 *)
val get_exn : 'a t -> 'a val get_exn : 'a t -> 'a
(** Open the option, possibly failing if it is [None] (** Open the option, possibly failing if it is [None]

View file

@ -78,25 +78,25 @@ val singleton : 'a -> 'a t
val doubleton : 'a -> 'a -> 'a t val doubleton : 'a -> 'a -> 'a t
(** Sequence with exactly two elements (** Sequence with exactly two elements
@since 0.4 *) @since 0.3.4 *)
val cons : 'a -> 'a t -> 'a t val cons : 'a -> 'a t -> 'a t
(** [cons x l] yields [x], then yields from [l]. (** [cons x l] yields [x], then yields from [l].
Same as [append (singleton x) l] Same as [append (singleton x) l]
@since 0.4 *) @since 0.3.4 *)
val snoc : 'a t -> 'a -> 'a t val snoc : 'a t -> 'a -> 'a t
(** Same as {!cons} but yields the element after iterating on [l] (** Same as {!cons} but yields the element after iterating on [l]
@since 0.4 *) @since 0.3.4 *)
val return : 'a -> 'a t val return : 'a -> 'a t
(** Synonym to {!singleton} (** Synonym to {!singleton}
@since 0.4 *) @since 0.3.4 *)
val pure : 'a -> 'a t val pure : 'a -> 'a t
(** Synonym to {!singleton} (** Synonym to {!singleton}
@since 0.4 *) @since 0.3.4 *)
val repeat : 'a -> 'a t val repeat : 'a -> 'a t
(** Infinite sequence of the same element. You may want to look (** Infinite sequence of the same element. You may want to look
@ -146,11 +146,11 @@ val exists : ('a -> bool) -> 'a t -> bool
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool
(** Is the value a member of the sequence? (** Is the value a member of the sequence?
@param eq the equality predicate to use (default [(=)]) @param eq the equality predicate to use (default [(=)])
@since 0.4 *) @since 0.3.4 *)
val find : ('a -> 'b option) -> 'a t -> 'b option val find : ('a -> 'b option) -> 'a t -> 'b option
(** Find the first element on which the function doesn't return [None] (** Find the first element on which the function doesn't return [None]
@since 0.4 *) @since 0.3.4 *)
val length : 'a t -> int val length : 'a t -> int
(** How long is the sequence? Forces the sequence. *) (** How long is the sequence? Forces the sequence. *)
@ -179,14 +179,14 @@ val flatMap : ('a -> 'b t) -> 'a t -> 'b t
val flat_map : ('a -> 'b t) -> 'a t -> 'b t val flat_map : ('a -> 'b t) -> 'a t -> 'b t
(** Alias to {!flatMap} with a more explicit name (** Alias to {!flatMap} with a more explicit name
@since 0.4 *) @since 0.3.4 *)
val fmap : ('a -> 'b option) -> 'a t -> 'b t val fmap : ('a -> 'b option) -> 'a t -> 'b t
(** Specialized version of {!flatMap} for options. *) (** Specialized version of {!flatMap} for options. *)
val filter_map : ('a -> 'b option) -> 'a t -> 'b t val filter_map : ('a -> 'b option) -> 'a t -> 'b t
(** Alias to {!fmap} with a more explicit name (** Alias to {!fmap} with a more explicit name
@since 0.4 *) @since 0.3.4 *)
val intersperse : 'a -> 'a t -> 'a t val intersperse : 'a -> 'a t -> 'a t
(** Insert the single element between every element of the sequence *) (** Insert the single element between every element of the sequence *)
@ -210,7 +210,7 @@ val persistent_lazy : 'a t -> 'a t
is interrupted prematurely ({!take}, etc.) then [s'] will not be is interrupted prematurely ({!take}, etc.) then [s'] will not be
memorized, and the next call to [s'] will traverse [s] again. memorized, and the next call to [s'] will traverse [s] again.
@since 0.4 *) @since 0.3.4 *)
(** {2 Misc} *) (** {2 Misc} *)
@ -237,7 +237,7 @@ val product : 'a t -> 'b t -> ('a * 'b) t
val product2 : 'a t -> 'b t -> ('a, 'b) t2 val product2 : 'a t -> 'b t -> ('a, 'b) t2
(** Binary version of {!product}. Same requirements. (** Binary version of {!product}. Same requirements.
@since 0.4 *) @since 0.3.4 *)
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t 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 (** [join ~join_row a b] combines every element of [a] with every
@ -264,12 +264,12 @@ val min : ?lt:('a -> 'a -> bool) -> 'a t -> 'a option
val head : 'a t -> 'a option val head : 'a t -> 'a option
(** First element, if any, otherwise [None] (** First element, if any, otherwise [None]
@since 0.4 *) @since 0.3.4 *)
val head_exn : 'a t -> 'a val head_exn : 'a t -> 'a
(** First element, if any, fails (** First element, if any, fails
@raise Invalid_argument if the sequence is empty @raise Invalid_argument if the sequence is empty
@since 0.4 *) @since 0.3.4 *)
val take : int -> 'a t -> 'a t val take : int -> 'a t -> 'a t
(** Take at most [n] elements from the sequence. Works on infinite (** Take at most [n] elements from the sequence. Works on infinite
@ -279,14 +279,14 @@ val take_while : ('a -> bool) -> 'a t -> 'a t
(** Take elements while they satisfy the predicate, then stops iterating. (** Take elements while they satisfy the predicate, then stops iterating.
Will work on an infinite sequence [s] if the predicate is false for at Will work on an infinite sequence [s] if the predicate is false for at
least one element of [s]. least one element of [s].
@since 0.4 *) @since 0.3.4 *)
val drop : int -> 'a t -> 'a t val drop : int -> 'a t -> 'a t
(** Drop the [n] first elements of the sequence. Lazy. *) (** Drop the [n] first elements of the sequence. Lazy. *)
val drop_while : ('a -> bool) -> 'a t -> 'a t val drop_while : ('a -> bool) -> 'a t -> 'a t
(** Predicate version of {!drop} (** Predicate version of {!drop}
@since 0.4 *) @since 0.3.4 *)
val rev : 'a t -> 'a t val rev : 'a t -> 'a t
(** Reverse the sequence. O(n) memory and time, needs the (** Reverse the sequence. O(n) memory and time, needs the
@ -331,12 +331,12 @@ val of_list : 'a list -> 'a t
val on_list : ('a t -> 'b t) -> 'a list -> 'b list val on_list : ('a t -> 'b t) -> 'a list -> 'b list
(** [on_list f l] is equivalent to [to_list @@ f @@ of_list l]. (** [on_list f l] is equivalent to [to_list @@ f @@ of_list l].
@since 0.4 @since 0.3.4
*) *)
val to_opt : 'a t -> 'a option val to_opt : 'a t -> 'a option
(** Alias to {!head} (** Alias to {!head}
@since 0.4 *) @since 0.3.4 *)
val to_array : 'a t -> 'a array val to_array : 'a t -> 'a array
(** Convert to an array. Currently not very efficient because (** Convert to an array. Currently not very efficient because
@ -355,7 +355,7 @@ val array_slice : 'a array -> int -> int -> 'a t
val of_opt : 'a option -> 'a t val of_opt : 'a option -> 'a t
(** Iterate on 0 or 1 values. (** Iterate on 0 or 1 values.
@since 0.4 *) @since 0.3.4 *)
val of_stream : 'a Stream.t -> 'a t val of_stream : 'a Stream.t -> 'a t
(** Sequence of elements of a stream (usable only once) *) (** Sequence of elements of a stream (usable only once) *)
@ -404,7 +404,7 @@ val to_str : char t -> string
val concat_str : string t -> string val concat_str : string t -> string
(** Concatenate strings together, eagerly. (** Concatenate strings together, eagerly.
Also see {!intersperse} to add a separator. Also see {!intersperse} to add a separator.
@since 0.4 *) @since 0.3.4 *)
exception OneShotSequence exception OneShotSequence
(** Raised when the user tries to iterate several times on (** Raised when the user tries to iterate several times on
@ -457,10 +457,10 @@ module Set : sig
val to_seq : t -> elt sequence val to_seq : t -> elt sequence
val to_list : t -> elt list val to_list : t -> elt list
(** @since 0.4 *) (** @since 0.3.4 *)
val of_list : elt list -> t val of_list : elt list -> t
(** @since 0.4 *) (** @since 0.3.4 *)
end end
(** Create an enriched Set module from the given one *) (** Create an enriched Set module from the given one *)
@ -481,10 +481,10 @@ module Map : sig
val values : 'a t -> 'a sequence val values : 'a t -> 'a sequence
val to_list : 'a t -> (key * 'a) list val to_list : 'a t -> (key * 'a) list
(** @since 0.4 *) (** @since 0.3.4 *)
val of_list : (key * 'a) list -> 'a t val of_list : (key * 'a) list -> 'a t
(** @since 0.4 *) (** @since 0.3.4 *)
end end
(** Adapt a pre-existing Map module to make it sequence-aware *) (** Adapt a pre-existing Map module to make it sequence-aware *)
@ -526,19 +526,19 @@ module Infix : sig
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
(** Monadic bind (infix version of {!flat_map} (** Monadic bind (infix version of {!flat_map}
@since 0.4 *) @since 0.3.4 *)
val (>|=) : 'a t -> ('a -> 'b) -> 'b t val (>|=) : 'a t -> ('a -> 'b) -> 'b t
(** Infix version of {!map} (** Infix version of {!map}
@since 0.4 *) @since 0.3.4 *)
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
(** Applicative operator (product+application) (** Applicative operator (product+application)
@since 0.4 *) @since 0.3.4 *)
val (<+>) : 'a t -> 'a t -> 'a t val (<+>) : 'a t -> 'a t -> 'a t
(** Concatenation of sequences (** Concatenation of sequences
@since 0.4 *) @since 0.3.4 *)
end end
include module type of Infix include module type of Infix
@ -576,7 +576,7 @@ By chunks of [4096] bytes:
Sequence.IO.(chunks_of ~size:4096 "a" |> write_to "b");; Sequence.IO.(chunks_of ~size:4096 "a" |> write_to "b");;
]} ]}
@since 0.4 *) @since 0.3.4 *)
module IO : sig module IO : sig
val lines_of : ?mode:int -> ?flags:open_flag list -> val lines_of : ?mode:int -> ?flags:open_flag list ->

View file

@ -252,11 +252,11 @@ Sexp.Traverse.list_all pt_of_sexp sexp;;
module Traverse : sig module Traverse : sig
type 'a conv = t -> 'a option type 'a conv = t -> 'a option
(** A converter from S-expressions to 'a is a function [sexp -> 'a option]. (** A converter from S-expressions to 'a is a function [sexp -> 'a option].
@since 0.5 *) @since 0.4.1 *)
val map_opt : ('a -> 'b option) -> 'a list -> 'b list option val map_opt : ('a -> 'b option) -> 'a list -> 'b list option
(** Map over a list, failing as soon as the function fails on any element (** Map over a list, failing as soon as the function fails on any element
@since 0.5 *) @since 0.4.1 *)
val list_any : 'a conv -> t -> 'a option val list_any : 'a conv -> t -> 'a option
(** [list_any f (List l)] tries [f x] for every element [x] in [List l], (** [list_any f (List l)] tries [f x] for every element [x] in [List l],
@ -284,19 +284,19 @@ module Traverse : sig
val to_list_with : (t -> 'a option) -> 'a list conv val to_list_with : (t -> 'a option) -> 'a list conv
(** Expect a list, applies [f] to all the elements of the list, and succeeds (** Expect a list, applies [f] to all the elements of the list, and succeeds
only if [f] succeeded on every element only if [f] succeeded on every element
@since 0.5 *) @since 0.4.1 *)
val to_pair : (t * t) conv val to_pair : (t * t) conv
(** Expect a list of two elements *) (** Expect a list of two elements *)
val to_pair_with : 'a conv -> 'b conv -> ('a * 'b) conv val to_pair_with : 'a conv -> 'b conv -> ('a * 'b) conv
(** Same as {!to_pair} but applies conversion functions (** Same as {!to_pair} but applies conversion functions
@since 0.5 *) @since 0.4.1 *)
val to_triple : (t * t * t) conv val to_triple : (t * t * t) conv
val to_triple_with : 'a conv -> 'b conv -> 'c conv -> ('a * 'b * 'c) conv val to_triple_with : 'a conv -> 'b conv -> 'c conv -> ('a * 'b * 'c) conv
(* @since 0.5 *) (* @since 0.4.1 *)
val get_field : string -> t conv val get_field : string -> t conv
(** [get_field name e], when [e = List [(n1,x1); (n2,x2) ... ]], extracts (** [get_field name e], when [e = List [(n1,x1); (n2,x2) ... ]], extracts
@ -314,7 +314,7 @@ module Traverse : sig
(** [field_list name f "(... (name a b c d) ...record)"] (** [field_list name f "(... (name a b c d) ...record)"]
will look for a field based on the given [name], and expect it to have a will look for a field based on the given [name], and expect it to have a
list of arguments dealt with by [f] (here, "a b c d"). list of arguments dealt with by [f] (here, "a b c d").
@since 0.5 *) @since 0.4.1 *)
val (>>=) : 'a option -> ('a -> 'b option) -> 'b option val (>>=) : 'a option -> ('a -> 'b option) -> 'b option