Skip to content

Commit

Permalink
hide Seq.diagonals, as an implementation detail
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Sep 27, 2021
1 parent 760ef15 commit 801d0fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
11 changes: 11 additions & 0 deletions stdlib/seq.ml
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,17 @@ let rec diagonals remainders xss () =
the remaining rows. *)
transpose remainders ()

(* If [xss] is a matrix (a sequence of rows), then [diagonals xss] is
the sequence of its diagonals.
The first diagonal contains just the first element of the
first row. The second diagonal contains the first element of the
second row and the second element of the first row; and so on.
- Every diagonal is a finite sequence.
- The rows of the matrix [xss] are not required to have the same length.
- The matrix [xss] is not required to be finite (in either direction).
- The matrix [xss] must be persistent. *)
let diagonals xss =
diagonals empty xss

Expand Down
18 changes: 0 additions & 18 deletions stdlib/seq.mli
Original file line number Diff line number Diff line change
Expand Up @@ -557,24 +557,6 @@ val transpose : 'a t t -> 'a t t
@since 4.14 *)

val diagonals : 'a t t -> 'a t t
(** If [xss] is a matrix (a sequence of rows), then [diagonals xss] is
the sequence of its diagonals.
The first diagonal contains just the first element of the
first row. The second diagonal contains the first element of the
second row and the second element of the first row; and so on.
Every diagonal is a finite sequence.
The rows of the matrix [xss] are not required to have the same length.
The matrix [xss] is not required to be finite (in either direction).
The matrix [xss] must be persistent.
@since 4.14 *)

(** {1 Combining sequences} *)

val append : 'a t -> 'a t -> 'a t
Expand Down

0 comments on commit 801d0fe

Please sign in to comment.