-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This attempts to make it more ergonomic to specify a codec chain while also retaining the ability to preserve codec chain invariants using the type system.
- Loading branch information
Showing
11 changed files
with
192 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
module Ndarray = Owl.Dense.Ndarray.Generic | ||
|
||
type dimension_order = int array | ||
|
||
type array_to_array = | ||
| Transpose of dimension_order | ||
type arraytoarray = | ||
[ `Transpose of int array ] | ||
|
||
type error = | ||
[ `Transpose_order of dimension_order * string ] | ||
[ `Transpose_order of int array * string ] | ||
|
||
module ArrayToArray : sig | ||
val parse | ||
: ('a, 'b) Util.array_repr -> | ||
array_to_array -> | ||
arraytoarray -> | ||
(unit, [> error]) result | ||
val compute_encoded_size : int -> array_to_array -> int | ||
val compute_encoded_size : int -> arraytoarray -> int | ||
val compute_encoded_representation | ||
: array_to_array -> | ||
: arraytoarray -> | ||
('a, 'b) Util.array_repr -> | ||
(('a, 'b) Util.array_repr, [> error]) result | ||
val encode | ||
: array_to_array -> | ||
: arraytoarray -> | ||
('a, 'b) Ndarray.t -> | ||
(('a, 'b) Ndarray.t, [> error]) result | ||
val decode | ||
: array_to_array -> | ||
: arraytoarray -> | ||
('a, 'b) Ndarray.t -> | ||
(('a, 'b) Ndarray.t, [> error]) result | ||
val of_yojson : Yojson.Safe.t -> (array_to_array, string) result | ||
val to_yojson : array_to_array -> Yojson.Safe.t | ||
val of_yojson : Yojson.Safe.t -> (arraytoarray, string) result | ||
val to_yojson : arraytoarray -> Yojson.Safe.t | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.