Skip to content

Commit

Permalink
Fixes for odoc (#1130)
Browse files Browse the repository at this point in the history
* Add missing module copy-s to dune

* Fix ambiguous doc comment in BatRandom

* Disable non-compiling array_filter bench with dune

* Suppress Toploop.directive_table deprecated alert

* Add camlp-streams and str to dune build for OCaml 5 compatibility

* Fix bench_int compilation with Stdlib

* Fix dune inline_tests nor preprocessing, adapt conditional $inject-s

* Fix deprecated String.nsplit in BatGc

* Suppress unused warnings in qtest

* Remove $Id comments which confuse qtest

* Split batteries_compattest from dune library

* Use test stanza for testsuite

* Add title to odoc index

* Remove duplicate title from ocamldoc index

* Fix BatSys.backend_type @SInCE

* Fix module synopses for odoc

* Fix most @raise annotations for odoc

* Fix @SInCE annotations for odoc

* Replace @added and @obsolete tags for odoc

* Fix heading levels for odoc

* Remove empty heading for odoc

* Remove spurious markup for odoc

* Fix ul formatting for odoc

* Add BatBytes to documentation index

* Fix ambiguities for odoc

* Revert symbol changes in BatChar documentation
  • Loading branch information
sim642 committed Apr 15, 2024
1 parent a234688 commit c4dfc61
Show file tree
Hide file tree
Showing 70 changed files with 749 additions and 637 deletions.
42 changes: 21 additions & 21 deletions src/batArray.mli
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)

(** {6 Array operations}
(** Array operations.
Arrays are mutable data structures with a fixed size, which
support fast access and modification, and are used pervasively in
Expand Down Expand Up @@ -341,7 +341,7 @@ val singleton : 'a -> 'a array
*)


(** {6 Sorting} *)
(** {1 Sorting} *)


val sort : ('a -> 'a -> int) -> 'a array -> unit
Expand Down Expand Up @@ -437,7 +437,7 @@ val pivot_split : 'a BatOrd.ord -> 'a array -> 'a -> int * int
*)


(**{6 Operations on two arrays}*)
(**{1 Operations on two arrays}*)

val iter2 : ('a -> 'b -> unit) -> 'a array -> 'b array -> unit
(** [Array.iter2 f [|a0; a1; ...; an|] [|b0; b1; ...; bn|]]
Expand Down Expand Up @@ -473,7 +473,7 @@ val cartesian_product : 'a array -> 'b array -> ('a * 'b) array
(** Cartesian product of the two arrays.
@since 2.2.0 *)

(**{6 Predicates}*)
(**{1 Predicates}*)

val for_all : ('a -> bool) -> 'a array -> bool
(** [for_all p [|a0; a1; ...; an|]] checks if all elements of the
Expand Down Expand Up @@ -542,15 +542,15 @@ val partition : ('a -> bool) -> 'a array -> 'a array * 'a array
elements of [a] that do not satisfy [p].
The order of the elements in the input array is preserved. *)

(** {6 Array transformations} *)
(** {1 Array transformations} *)

val rev : 'a array -> 'a array
(** Array reversal.*)

val rev_in_place : 'a array -> unit
(** In-place array reversal. The array argument is updated. *)

(** {6 Conversions} *)
(** {1 Conversions} *)

val enum : 'a array -> 'a BatEnum.t
(** Returns an enumeration of the elements of an array.
Expand All @@ -567,7 +567,7 @@ val of_backwards : 'a BatEnum.t -> 'a array
the enumeration as the last element of the array and vice
versa. *)

(** {6 Utilities} *)
(** {1 Utilities} *)

val range : 'a array -> int BatEnum.t
(** [range a] returns an enumeration of all valid indexes into the given
Expand All @@ -587,7 +587,7 @@ val remove_at : int -> 'a array -> 'a array
@raise Invalid_argument if [i] is outside of [a] bounds.
@since 3.3.0 *)

(** {6 Boilerplate code}*)
(** {1 Boilerplate code}*)

val print : ?first:string -> ?last:string -> ?sep:string ->
('a, 'b) BatIO.printer -> ('a t, 'b) BatIO.printer
Expand Down Expand Up @@ -628,7 +628,7 @@ val equal : 'a BatOrd.eq -> 'a array BatOrd.eq
equal if their lengths are the same and corresponding elements
test equal. *)

(** {6 Override modules}*)
(** {1 Override modules}*)

(** The following modules replace functions defined in {!Array} with
functions behaving slightly differently but having the same
Expand Down Expand Up @@ -722,13 +722,13 @@ sig
while a [('a, [`Read]) array] only has read-only capabilities
and a [('a, [`Write]) array] only has write-only capabilities.*)

(**{6 Base operations}*)
(**{1 Base operations}*)

external length : ('a, [> ]) t -> int = "%array_length"
external get : ('a, [> `Read]) t -> int -> 'a = "%array_safe_get"
external set : ('a, [> `Write]) t -> int -> 'a -> unit = "%array_safe_set"

(**{6 Constructors}*)
(**{1 Constructors}*)

external make : int -> 'a -> ('a, _) t = "caml_make_vect"
external create : int -> 'a -> ('a, _) t = "caml_make_vect"
Expand Down Expand Up @@ -771,7 +771,7 @@ sig
val make_matrix : int -> int -> 'a -> (('a, _)t, _) t
val create_matrix : int -> int -> 'a -> (('a, _)t, _) t

(** {6 Iterators}*)
(** {1 Iterators}*)

val iter : ('a -> unit) -> ('a, [> `Read]) t -> unit
val map : ('a -> 'b) -> ('a, [>`Read]) t -> ('b, _) t
Expand All @@ -784,12 +784,12 @@ sig
val fold_right : ('b -> 'a -> 'a) -> ('b, [> `Read]) t -> 'a -> 'a
val fold_while : ('acc -> 'a -> bool) -> ('acc -> 'a -> 'acc) -> 'acc -> ('a, [> `Read]) t -> ('acc * int)

(**{6 Operations on two arrays}*)
(**{1 Operations on two arrays}*)

val iter2 : ('a -> 'b -> unit) -> ('a, [> `Read]) t -> ('b, [> `Read]) t -> unit
val iter2i : (int -> 'a -> 'b -> unit) -> ('a, [> `Read]) t -> ('b, [> `Read]) t -> unit

(**{6 Predicates}*)
(**{1 Predicates}*)

val for_all : ('a -> bool) -> ('a, [> `Read]) t -> bool
val exists : ('a -> bool) -> ('a, [> `Read]) t -> bool
Expand All @@ -805,7 +805,7 @@ sig
val find_all : ('a -> bool) -> ('a, [> `Read]) t -> ('a, _) t
val partition : ('a -> bool) -> ('a, [> `Read]) t -> ('a, _) t * ('a, _)t

(** {6 Array transformations} *)
(** {1 Array transformations} *)

val rev : ('a, [> `Read]) t -> ('a, _) t
val rev_in_place : ('a, [`Read | `Write]) t -> unit
Expand All @@ -816,7 +816,7 @@ sig
val fill : ('a, [> `Write]) t -> int -> int -> 'a -> unit
val blit : ('a, [> `Read]) t -> int -> ('a, [>`Write]) t -> int -> int -> unit

(** {6 Conversions} *)
(** {1 Conversions} *)

val enum : ('a, [> `Read]) t -> 'a BatEnum.t
val of_enum : 'a BatEnum.t -> ('a, _) t
Expand All @@ -828,21 +828,21 @@ sig
val pivot_split : 'a BatOrd.ord -> ('a, [> `Read]) t -> 'a -> int * int
val of_list : 'a list -> ('a, _) t

(** {6 Utilities} *)
(** {1 Utilities} *)

val sort : ('a -> 'a -> int) -> ('a, [> `Read | `Write]) t -> unit
val stable_sort : ('a -> 'a -> int) -> ('a, [ `Read | `Write]) t -> unit
val fast_sort : ('a -> 'a -> int) -> ('a, [`Read | `Write]) t -> unit

(** {6 Boilerplate code}*)
(** {1 Boilerplate code}*)

val print : ?first:string -> ?last:string -> ?sep:string -> ('a BatIO.output -> 'b -> unit) -> 'a BatIO.output -> ('b, [>`Read]) t -> unit

val compare : 'a BatOrd.comp -> ('a, [> `Read]) t BatOrd.comp
val ord : 'a BatOrd.ord -> ('a, [> `Read]) t BatOrd.ord
val equal : 'a BatOrd.eq -> ('a, [> `Read]) t BatOrd.eq

(** {6 Override modules}*)
(** {1 Override modules}*)

(** Operations on {!BatArray.Cap} without exceptions.*)
module Exceptionless : sig
Expand Down Expand Up @@ -888,7 +888,7 @@ sig
val count_matching: f:('a -> bool) -> ('a, [>`Read]) t -> int
end
(**/**)
(** {6 Undocumented functions} *)
(** {1 Undocumented functions} *)

external unsafe_get : ('a, [> `Read]) t -> int -> 'a = "%array_unsafe_get"
external unsafe_set : ('a, [> `Write])t -> int -> 'a -> unit = "%array_unsafe_set"
Expand All @@ -910,7 +910,7 @@ end


(**/**)
(** {6 Undocumented functions} *)
(** {1 Undocumented functions} *)

(* for tests *)
val is_sorted_by : ('a -> 'b) -> 'a array -> bool
Expand Down
36 changes: 20 additions & 16 deletions src/batBig_int.mli
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ val one : big_int
val unit_big_int : big_int
(** The big integer [1]. *)

(** {6 Arithmetic operations} *)
(** {1 Arithmetic operations} *)

val neg : big_int -> big_int
val succ : big_int -> big_int
Expand Down Expand Up @@ -130,16 +130,18 @@ val power_big_int_positive_big_int: big_int -> big_int -> big_int
representing the first argument [a] raised to the power [b]
(the second argument). Depending
on the function, [a] and [b] can be either small integers
or big integers. @raise Invalid_argument if [b] is negative. *)
or big integers.
@raise Invalid_argument if [b] is negative. *)

val operations : t BatNumber.numeric

(** {6 Generators} *)
(** {1 Generators} *)

val ( -- ) : big_int -> big_int -> big_int BatEnum.t
val ( --- ): big_int -> big_int -> big_int BatEnum.t

(** {6 Comparisons and tests} *)
(** {1 Comparisons and tests} *)

val compare : big_int -> big_int -> int
val ord : big_int -> big_int -> BatOrd.order
Expand Down Expand Up @@ -188,7 +190,7 @@ val num_digits_big_int : big_int -> int
##V>=4.3## @since 2.5.0 and OCaml 4.03 *)


(** {6 Conversions to and from strings} *)
(** {1 Conversions to and from strings} *)

val to_string : big_int -> string
val string_of_big_int : big_int -> string
Expand Down Expand Up @@ -222,8 +224,9 @@ val to_string_in_base : int -> big_int -> string
(** [to_string_in_base b n] returns the string representation in base [b] of
the given big integer [n]. Should you have advanced needs (arbitrarily large
bases, or custom digits instead of the usual [0,1,...9,a,b,...,z]), use
[to_string_in_custom_base] instead. @raise Invalid_argument if b is not in
[2 .. 36]. *)
[to_string_in_custom_base] instead.
@raise Invalid_argument if b is not in [2 .. 36]. *)

val to_string_in_custom_base : string -> int -> big_int -> string
(** First argument, called [symbols], is the vector of the symbols used to
Expand All @@ -233,8 +236,9 @@ val to_string_in_custom_base : string -> int -> big_int -> string
provided that [symbols] can accommodate it. Concretely, the base [b] must be at
least [2], and [symbols] must be of size at least [b]. The default value of
[big_int_base_default_symbols] contains 62 symbols, as it uses lowercase and
uppercase letters both. See below for more information. @raise Invalid_argument
if [b] is incorrect. *)
uppercase letters both. See below for more information.
@raise Invalid_argument if [b] is incorrect. *)


val big_int_base_default_symbols : string
Expand All @@ -252,7 +256,7 @@ val big_int_base_default_symbols : string
*)


(** {6 Conversions to and from other numerical types} *)
(** {1 Conversions to and from other numerical types} *)


val of_int : int -> big_int
Expand Down Expand Up @@ -335,7 +339,7 @@ val of_float: float -> big_int
val to_float: big_int -> float


(** {6 Bit-oriented operations} *)
(** {1 Bit-oriented operations} *)

val and_big_int : big_int -> big_int -> big_int
(** Bitwise logical ``and''.
Expand Down Expand Up @@ -372,14 +376,14 @@ val extract_big_int : big_int -> int -> int -> big_int
a two's complement representation is used. *)


(** {6 Submodules grouping all infix operators} *)
(** {1 Submodules grouping all infix operators} *)

module Infix : BatNumber.Infix with type bat__infix_t = t
module Compare : BatNumber.Compare with type bat__compare_t = t

(**/**)

(** {6 For internal use} *)
(** {1 For internal use} *)
val nat_of_big_int : big_int -> Nat.nat
val big_int_of_nat : Nat.nat -> big_int
val base_power_big_int: int -> int -> big_int -> big_int
Expand All @@ -388,7 +392,7 @@ val round_futur_last_digit : Bytes.t -> int -> int -> bool
val approx_big_int: int -> big_int -> string
##V>=4.3##val round_big_int_to_float: big_int -> bool -> float

(** {6 Obsolete}*)
(** {1 Obsolete}*)

val zero_big_int : big_int
(** The big integer [0]. *)
Expand Down Expand Up @@ -432,8 +436,8 @@ val gcd_big_int : big_int -> big_int -> big_int

(**/**)

(** {6 Boilerplate code} *)
(** {1 Boilerplate code} *)

(** {7 Printing} *)
(** {2 Printing} *)

val print : 'a BatIO.output -> t -> unit
Loading

0 comments on commit c4dfc61

Please sign in to comment.