-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
67 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
(* Note: copied from src/gen/mkshims.ml *) | ||
module type I = sig | ||
type ('i, 'a, 'e) t | ||
type ('i, 'a) t | ||
|
||
val ( >|= ) : ('i, 'a, 'e) t -> ('a -> 'b) -> ('i, 'b, 'e) t | ||
val ( >|= ) : ('i, 'a) t -> ('a -> 'b) -> ('i, 'b) t | ||
|
||
val monoid_product : ('i, 'a, 'e) t -> ('i, 'b, 'e) t -> ('i, 'a * 'b, 'e) t | ||
val monoid_product : ('i, 'a) t -> ('i, 'b) t -> ('i, 'a * 'b) t | ||
|
||
val ( >>= ) : ('i, 'a, 'e) t -> ('a -> ('i, 'b, 'e) t) -> ('i, 'b, 'e) t | ||
val ( >>= ) : ('i, 'a) t -> ('a -> ('i, 'b) t) -> ('i, 'b) t | ||
end | ||
|
||
module type S = sig | ||
type ('i, 'a, 'e) t_let | ||
type ('i, 'a) t_let | ||
end | ||
|
||
module Make (X : I) = struct | ||
type ('i, 'a, 'e) t_let = ('i, 'a, 'e) X.t | ||
type ('i, 'a) t_let = ('i, 'a) X.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
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,49 +1,47 @@ | ||
(** An [('i, 'o, 'e) t] is a decoder that | ||
(** An [('i, 'o) t] is a decoder that | ||
- consumes a value of type ['i] | ||
- producing a value of type ['o] | ||
- or an error of type ['e] | ||
- produces a value of type ['o] or an error of type ['i Error.t] | ||
*) | ||
type ('i, 'o, 'e) t = 'i -> ('o, 'e) result | ||
type ('i, 'o) t = 'i -> ('o, 'i Error.t) result | ||
|
||
val pure : 'o -> ('i, 'o, 'e) t | ||
val pure : 'o -> ('i, 'o) t | ||
(** [pure x] always succeeds with [x] *) | ||
|
||
val fail : 'e -> ('i, 'o, 'e) t | ||
val fail : 'i Error.t -> ('i, 'o) t | ||
(** [fail e] always fails with [e] *) | ||
|
||
val of_result : ('o, 'e) Decoders_util.My_result.t -> ('i, 'o, 'e) t | ||
val of_result : ('o, 'i Error.t) Decoders_util.My_result.t -> ('i, 'o) t | ||
|
||
val bind : ('a -> ('i, 'b, 'e) t) -> ('i, 'a, 'e) t -> ('i, 'b, 'e) t | ||
val bind : ('a -> ('i, 'b) t) -> ('i, 'a) t -> ('i, 'b) t | ||
|
||
val map : ('a -> 'b) -> ('i, 'a, 'e) t -> ('i, 'b, 'e) t | ||
val map : ('a -> 'b) -> ('i, 'a) t -> ('i, 'b) t | ||
|
||
val map_err : ('e1 -> 'e2) -> ('i, 'o, 'e1) t -> ('i, 'o, 'e2) t | ||
val map_err : ('i Error.t -> 'i Error.t) -> ('i, 'o) t -> ('i, 'o) t | ||
|
||
val apply : ('i, 'a -> 'b, 'e) t -> ('i, 'a, 'e) t -> ('i, 'b, 'e) t | ||
val apply : ('i, 'a -> 'b) t -> ('i, 'a) t -> ('i, 'b) t | ||
|
||
module Infix : sig | ||
val ( >>= ) : ('i, 'a, 'e) t -> ('a -> ('i, 'b, 'e) t) -> ('i, 'b, 'e) t | ||
val ( >>= ) : ('i, 'a) t -> ('a -> ('i, 'b) t) -> ('i, 'b) t | ||
|
||
val ( >|= ) : ('i, 'a, 'e) t -> ('a -> 'b) -> ('i, 'b, 'e) t | ||
val ( >|= ) : ('i, 'a) t -> ('a -> 'b) -> ('i, 'b) t | ||
|
||
val ( <*> ) : ('i, 'a -> 'b, 'e) t -> ('i, 'a, 'e) t -> ('i, 'b, 'e) t | ||
val ( <*> ) : ('i, 'a -> 'b) t -> ('i, 'a) t -> ('i, 'b) t | ||
|
||
include Shims_let_ops_.S with type ('i, 'o, 'e) t_let = ('i, 'o, 'e) t | ||
include Shims_let_ops_.S with type ('i, 'o) t_let = ('i, 'o) t | ||
end | ||
|
||
val fix : (('i, 'a, 'e) t -> ('i, 'a, 'e) t) -> ('i, 'a, 'e) t | ||
val fix : (('i, 'a) t -> ('i, 'a) t) -> ('i, 'a) t | ||
|
||
val value : ('i, 'i, 'e) t | ||
val value : ('i, 'i) t | ||
|
||
val maybe : ('i, 'a, 'e) t -> ('i, 'a option, 'e) t | ||
val maybe : ('i, 'a) t -> ('i, 'a option) t | ||
|
||
val one_of : | ||
combine_errors:('e list -> 'e) -> ('i, 'o, 'e) t list -> ('i, 'o, 'e) t | ||
('i, 'o) t list -> ('i, 'o) t | ||
|
||
val pick : | ||
combine_errors:('e list -> 'e) | ||
-> ('i, ('i, 'o, 'e) t, 'e) t list | ||
-> ('i, 'o, 'e) t | ||
('i, ('i, 'o) t) t list | ||
-> ('i, 'o) t | ||
|
||
val of_to_opt : ('i -> 'o option) -> ('i -> ('o, 'e) result) -> ('i, 'o, 'e) t | ||
val of_to_opt : ('i -> 'o option) -> ('i -> ('o, 'i Error.t) result) -> ('i, 'o) t |
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