Skip to content

Commit

Permalink
Merge branch 'master' into remove-trailing-whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrek authored Oct 15, 2024
2 parents c2a0d7f + 4c54a4a commit 23cdfb3
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 109 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ jobs:
fail-fast: false
matrix:
ocaml-version:
- 4.02.3
- 4.05.0
- 4.11.1
- 4.14.1
- 5.1.0
- 5.2.0
- "4.02"
- "4.05"
- "4.11"
- "4.14"
- "5"
os:
- ubuntu-latest
include:
- ocaml-version: 4.14.1
- ocaml-version: "4.14"
os: macos-latest
- ocaml-version: 4.14.1
- ocaml-version: "4.14"
os: windows-latest

runs-on: ${{ matrix.os }}
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ OCaml Extended standard Library - ExtLib
[![Build](https://github.com/ygrek/ocaml-extlib/actions/workflows/workflow.yml/badge.svg)](https://github.com/ygrek/ocaml-extlib/actions/workflows/workflow.yml)

```
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version,,
* with the special exception on linking described in file LICENSE.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version,,
with the special exception on linking described in file LICENSE.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
```

What is ExtLib ?
Expand Down
16 changes: 8 additions & 8 deletions src/IO.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exception Input_closed
exception Output_closed
(** This exception is raised when reading on a closed output. *)

(** {6 Standard API} *)
(** {1 Standard API} *)

val read : input -> char
(** Read a single char from an input or raise [No_more_input] if
Expand Down Expand Up @@ -75,7 +75,7 @@ val input : input -> Bytes.t -> int -> int -> int
val really_input : input -> Bytes.t -> int -> int -> int
(** [really_input i b p l] reads exactly [l] characters from the given input,
storing them in the buffer [b], starting at position [p]. For consistency with
{!IO.input} it returns [l]. Raises [No_more_input] if at [l] characters are
{!val:IO.input} it returns [l]. Raises [No_more_input] if at [l] characters are
not available. Raises [Invalid_argument] if [p] and [l] do not designate a
valid subsequence of [b]. *)

Expand All @@ -99,7 +99,7 @@ val output : 'a output -> Bytes.t -> int -> int -> int
val really_output : 'a output -> Bytes.t -> int -> int -> int
(** [really_output o b p l] writes exactly [l] characters from byte sequence [b] onto
the the output, starting with the character at offset [p]. For consistency with
{!IO.output} it returns [l]. Raises [Invalid_argument] if [p] and [l] do not
{!val:IO.output} it returns [l]. Raises [Invalid_argument] if [p] and [l] do not
designate a valid subsequence of [b]. *)

val flush : 'a output -> unit
Expand All @@ -109,7 +109,7 @@ val close_out : 'a output -> 'a
(** Close the output and return its accumulator data.
It can no longer be written. *)

(** {6 Creation of IO Inputs/Outputs} *)
(** {1 Creation of IO Inputs/Outputs} *)

val input_string : string -> input
(** Create an input that will read from a string. *)
Expand Down Expand Up @@ -155,7 +155,7 @@ val create_out :
flush:(unit -> unit) -> close:(unit -> 'a) -> 'a output
(** Fully create an output by giving all the needed functions. *)

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

val scanf : input -> ('a, 'b, 'c, 'd) Scanf.scanner
(** The scanf function works for any input. *)
Expand All @@ -182,7 +182,7 @@ external cast_output : 'a output -> unit output = "%identity"
(** You can safely transform any output to an unit output in a safe way
by using this function. *)

(** {6 Binary files API}
(** {1 Binary files API}
Here is some API useful for working with binary files, in particular
binary files generated by C applications. By default, encoding of
Expand Down Expand Up @@ -298,7 +298,7 @@ sig

end

(** {6 Bits API}
(** {1 Bits API}
This enable you to read and write from an IO bit-by-bit or several bits
at the same time.
Expand Down Expand Up @@ -328,7 +328,7 @@ val flush_bits : out_bits -> unit
val drop_bits : in_bits -> unit
(** Drop up to 7 buffered bits and restart to next input character. *)

(** {6 Generic IO Object Wrappers}
(** {1 Generic IO Object Wrappers}
Theses OO Wrappers have been written to provide easy support of ExtLib
IO by external librairies. If you want your library to support ExtLib
Expand Down
10 changes: 5 additions & 5 deletions src/dllist.mli
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type 'a node_t (* abstract *)

exception Empty

(** {6 node functions } *)
(** {1 node functions } *)

(** Creates a node. This is an O(1) operation. *)
val create : 'a -> 'a node_t
Expand Down Expand Up @@ -105,7 +105,7 @@ val set : 'a node_t -> 'a -> unit
(** Given a node, get the next element in the list after the node.
The list is circular, so the last node of the list returns the first
node of the list as it's next node.
node of the list as its next node.
This is an O(1) operation.
*)
Expand All @@ -114,7 +114,7 @@ val next : 'a node_t -> 'a node_t
(** Given a node, get the previous element in the list before the node.
The list is circular, so the first node of the list returns the
last element of the list as it's previous node.
last element of the list as its previous node.
This is an O(1) operation.
*)
Expand Down Expand Up @@ -150,7 +150,7 @@ val fold_right : ('a -> 'b -> 'b) -> 'a node_t -> 'b -> 'b
val map : ('a -> 'b) -> 'a node_t -> 'b node_t


(** {6 list conversion } *)
(** {1 list conversion } *)

(** Converts a dllist to a normal list. This is an O(N) operation. *)
val to_list : 'a node_t -> 'a list
Expand All @@ -161,7 +161,7 @@ val to_list : 'a node_t -> 'a list
val of_list : 'a list -> 'a node_t


(** {6 enums } *)
(** {1 enums } *)

(** Create an enum of the list.
Note that modifying the list while the enum exists will have undefined
Expand Down
2 changes: 1 addition & 1 deletion src/dynArray.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*
* DynArray - Resizeable Ocaml arrays
* DynArray - Resizeable OCaml arrays
* Copyright (C) 2003 Brian Hurt
* Copyright (C) 2003 Nicolas Cannasse
*
Expand Down
18 changes: 9 additions & 9 deletions src/dynArray.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*
* DynArray - Resizeable Ocaml arrays
* DynArray - Resizeable OCaml arrays
* Copyright (C) 2003 Brian Hurt
* Copyright (C) 2003 Nicolas Cannasse
*
Expand Down Expand Up @@ -35,7 +35,7 @@ exception Invalid_arg of int * string * string
contains the parameter name that made the operation fail.
*)

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

val create : unit -> 'a t
(** [create()] returns a new empty dynamic array. *)
Expand All @@ -48,7 +48,7 @@ val init : int -> (int -> 'a) -> 'a t
(** [init n f] returns an array of [n] elements filled with values
returned by [f 0 , f 1, ... f (n-1)]. *)

(** {6 Array manipulation functions} *)
(** {1 Array manipulation functions} *)

val empty : 'a t -> bool
(** Return true if the number of elements in the array is 0. *)
Expand Down Expand Up @@ -104,7 +104,7 @@ val blit : 'a t -> int -> 'a t -> int -> int -> unit
val compact : 'a t -> unit
(** [compact darr] ensures that the space allocated by the array is minimal.*)

(** {6 Array copy and conversion} *)
(** {1 Array copy and conversion} *)

val to_list : 'a t -> 'a list
(** [to_list darr] returns the elements of [darr] in order as a list. *)
Expand Down Expand Up @@ -135,7 +135,7 @@ val sub : 'a t -> int -> int -> 'a t
(** [sub darr start len] returns an array holding the subset of [len]
elements from [darr] starting with the element at index [idx]. *)

(** {6 Array functional support} *)
(** {1 Array functional support} *)

val iter : ('a -> unit) -> 'a t -> unit
(** [iter f darr] calls the function [f] on every element of [darr]. It
Expand Down Expand Up @@ -172,7 +172,7 @@ val index_of : ('a -> bool) -> 'a t -> int

val filter : ('a -> bool) -> 'a t -> unit

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

type resizer_t = currslots:int -> oldlength:int -> newlength:int -> int
(** The type of a resizer function.
Expand Down Expand Up @@ -260,11 +260,11 @@ val step_resizer : int -> resizer_t
The resizer returned by [step_resizer step] returns the smallest
multiple of [step] larger than [newlength] if [currslots] is less
then [newlength]-[step] or greater than [newlength].
then [newlength-step] or greater than [newlength].
For example, to make an darray with a step of 10, a length
of len, and a null of null, you would do:
[make] ~resizer:([step_resizer] 10) len null
[make ~resizer:(step_resizer 10) len null]
*)

val conservative_exponential_resizer : resizer_t
Expand All @@ -275,7 +275,7 @@ val conservative_exponential_resizer : resizer_t
than that, it acts like [exponential_resizer].
*)

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

val unsafe_get : 'a t -> int -> 'a
val unsafe_set : 'a t -> int -> 'a -> unit
10 changes: 5 additions & 5 deletions src/enum.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

type 'a t

(** {6 Final functions}
(** {1 Final functions}
These functions consume the enumeration until
it ends or an exception is raised by the first
Expand Down Expand Up @@ -66,7 +66,7 @@ val foldi : (int -> 'a -> 'b -> 'b) -> 'b -> 'a t -> 'b

val fold2i : (int -> 'a -> 'b -> 'c -> 'c) -> 'c -> 'a t -> 'b t -> 'c

(** {6 Useful functions} *)
(** {1 Useful functions} *)

val find : ('a -> bool) -> 'a t -> 'a
(** [find f e] returns the first element [x] of [e] such that [f x] returns
Expand Down Expand Up @@ -110,7 +110,7 @@ val force : 'a t -> unit
of enumerated elements is constructed and [e] will now enumerate over
that data structure. *)

(** {6 Lazy constructors}
(** {1 Lazy constructors}
These functions are lazy which means that they will create a new modified
enumeration without actually enumerating any element until they are asked
Expand Down Expand Up @@ -143,7 +143,7 @@ val concat : 'a t t -> 'a t
(** [concat e] returns an enumeration over all elements of all enumerations
of [e]. *)

(** {6 Constructors}
(** {1 Constructors}
In this section the word {i shall} denotes a semantic
requirement. The correct operation
Expand Down Expand Up @@ -188,7 +188,7 @@ val init : int -> (int -> 'a) -> 'a t
(** [init n f] creates a new enumeration over elements
[f 0, f 1, ..., f (n-1)] *)

(** {6 Counting} *)
(** {1 Counting} *)

val count : 'a t -> int
(** [count e] returns the number of remaining elements in [e] without
Expand Down
12 changes: 6 additions & 6 deletions src/extArray.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sig

type 'a t = 'a array

(** {6 New functions} *)
(** {1 New functions} *)
val rev : 'a array -> 'a array
(** Array reversal. *)

Expand Down Expand Up @@ -100,15 +100,15 @@ sig
elements of [a] that do not satisfy [p].
The order of the elements in the input array is preserved. *)

(** {6 Enumerations} *)
(** {1 Enumerations} *)

val enum : 'a array -> 'a Enum.t
(** Returns an enumeration of the elements of an array. *)

val of_enum : 'a Enum.t -> 'a array
(** Build an array from an enumeration. *)

(** {6 Compatibility functions} *)
(** {1 Compatibility functions} *)

(** These functions are reimplemented in extlib when they are missing from the stdlib *)

Expand Down Expand Up @@ -142,10 +142,10 @@ sig
(** Same as {!Array.exists}, but for a two-argument predicate.
@raise Invalid_argument if the two arrays have different lengths. *)

(** {6 Old functions} *)
(** {1 Old functions} *)

(** These functions are already part of the Ocaml standard library
and have not been modified. Please refer to the Ocaml Manual for
(** These functions are already part of the OCaml standard library
and have not been modified. Please refer to the OCaml Manual for
documentation. *)

external length : 'a array -> int = "%array_length"
Expand Down
6 changes: 3 additions & 3 deletions src/extHashtbl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Hashtbl :
type ('a,'b) t = ('a,'b) Hashtbl.t
(** The type of a hashtable. *)

(** {6 New Functions} *)
(** {1 New Functions} *)

val exists : ('a,'b) t -> 'a -> bool
(** [exists h k] returns true is at least one item with key [k] is
Expand Down Expand Up @@ -90,9 +90,9 @@ module Hashtbl :
val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit
#endif

(** {6 Older Functions} *)
(** {1 Older Functions} *)

(** Please refer to the Ocaml Manual for documentation of these
(** Please refer to the OCaml Manual for documentation of these
functions. *)

val create : ?random:bool -> int -> ('a, 'b) t
Expand Down
2 changes: 1 addition & 1 deletion src/extLib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Since ExtLib is provided for namespace convenience for
users who wants to keep the usage of the original
Ocaml Standard Library, no MLI CMI nor documentation will
OCaml Standard Library, no MLI CMI nor documentation will
be provided for this module.
Users can simply do an "open ExtLib" to import all Ext*
Expand Down
Loading

0 comments on commit 23cdfb3

Please sign in to comment.