|
|
739fb1 |
--- a/csexp.opam
|
|
|
739fb1 |
+++ b/csexp.opam
|
|
|
739fb1 |
@@ -32,7 +32,6 @@ bug-reports: "https://github.com/ocaml-d
|
|
|
739fb1 |
depends: [
|
|
|
739fb1 |
"dune" {>= "1.11"}
|
|
|
739fb1 |
"ocaml" {>= "4.02.3"}
|
|
|
739fb1 |
- "result" {>= "1.5"}
|
|
|
739fb1 |
]
|
|
|
739fb1 |
dev-repo: "git+https://github.com/ocaml-dune/csexp.git"
|
|
|
739fb1 |
build: [
|
|
|
739fb1 |
--- a/src/csexp.ml
|
|
|
739fb1 |
+++ b/src/csexp.ml
|
|
|
739fb1 |
@@ -15,12 +15,6 @@ end
|
|
|
739fb1 |
module Make (Sexp : Sexp) = struct
|
|
|
739fb1 |
open Sexp
|
|
|
739fb1 |
|
|
|
739fb1 |
- (* This is to keep compatibility with 4.02 without writing [Result.]
|
|
|
739fb1 |
- everywhere *)
|
|
|
739fb1 |
- type ('a, 'b) result = ('a, 'b) Result.result =
|
|
|
739fb1 |
- | Ok of 'a
|
|
|
739fb1 |
- | Error of 'b
|
|
|
739fb1 |
-
|
|
|
739fb1 |
module Parser = struct
|
|
|
739fb1 |
exception Parse_error of string
|
|
|
739fb1 |
|
|
|
739fb1 |
@@ -283,9 +277,9 @@ module Make (Sexp : Sexp) = struct
|
|
|
739fb1 |
|
|
|
739fb1 |
module Monad : Monad
|
|
|
739fb1 |
|
|
|
739fb1 |
- val read_string : t -> int -> (string, string) Result.t Monad.t
|
|
|
739fb1 |
+ val read_string : t -> int -> (string, string) result Monad.t
|
|
|
739fb1 |
|
|
|
739fb1 |
- val read_char : t -> (char, string) Result.t Monad.t
|
|
|
739fb1 |
+ val read_char : t -> (char, string) result Monad.t
|
|
|
739fb1 |
end
|
|
|
739fb1 |
|
|
|
739fb1 |
module Make_parser (Input : Input) = struct
|
|
|
739fb1 |
--- a/src/csexp.mli
|
|
|
739fb1 |
+++ b/src/csexp.mli
|
|
|
739fb1 |
@@ -33,24 +33,24 @@ module Make (Sexp : Sexp) : sig
|
|
|
739fb1 |
[s]. It is an error for [s] to contain a S-expression followed by more
|
|
|
739fb1 |
data. In case of error, the offset of the error as well as an error
|
|
|
739fb1 |
message is returned. *)
|
|
|
739fb1 |
- val parse_string : string -> (Sexp.t, int * string) Result.t
|
|
|
739fb1 |
+ val parse_string : string -> (Sexp.t, int * string) result
|
|
|
739fb1 |
|
|
|
739fb1 |
(** [parse_string s] parses a sequence of S-expressions encoded in canonical
|
|
|
739fb1 |
form in [s] *)
|
|
|
739fb1 |
- val parse_string_many : string -> (Sexp.t list, int * string) Result.t
|
|
|
739fb1 |
+ val parse_string_many : string -> (Sexp.t list, int * string) result
|
|
|
739fb1 |
|
|
|
739fb1 |
(** Read exactly one canonical S-expressions from the given channel. Note that
|
|
|
739fb1 |
this function never raises [End_of_file]. Instead, it returns [Error]. *)
|
|
|
739fb1 |
- val input : in_channel -> (Sexp.t, string) Result.t
|
|
|
739fb1 |
+ val input : in_channel -> (Sexp.t, string) result
|
|
|
739fb1 |
|
|
|
739fb1 |
(** Same as [input] but returns [Ok None] if the end of file has already been
|
|
|
739fb1 |
reached. If some more characters are available but the end of file is
|
|
|
739fb1 |
reached before reading a complete S-expression, this function returns
|
|
|
739fb1 |
[Error]. *)
|
|
|
739fb1 |
- val input_opt : in_channel -> (Sexp.t option, string) Result.t
|
|
|
739fb1 |
+ val input_opt : in_channel -> (Sexp.t option, string) result
|
|
|
739fb1 |
|
|
|
739fb1 |
(** Read many S-expressions until the end of input is reached. *)
|
|
|
739fb1 |
- val input_many : in_channel -> (Sexp.t list, string) Result.t
|
|
|
739fb1 |
+ val input_many : in_channel -> (Sexp.t list, string) result
|
|
|
739fb1 |
|
|
|
739fb1 |
(** {2 Serialising} *)
|
|
|
739fb1 |
|
|
|
739fb1 |
@@ -352,18 +352,18 @@ module Make (Sexp : Sexp) : sig
|
|
|
739fb1 |
val bind : 'a t -> ('a -> 'b t) -> 'b t
|
|
|
739fb1 |
end
|
|
|
739fb1 |
|
|
|
739fb1 |
- val read_string : t -> int -> (string, string) Result.t Monad.t
|
|
|
739fb1 |
+ val read_string : t -> int -> (string, string) result Monad.t
|
|
|
739fb1 |
|
|
|
739fb1 |
- val read_char : t -> (char, string) Result.t Monad.t
|
|
|
739fb1 |
+ val read_char : t -> (char, string) result Monad.t
|
|
|
739fb1 |
end
|
|
|
739fb1 |
[@@deprecated "Use Parser module instead"]
|
|
|
739fb1 |
|
|
|
739fb1 |
[@@@warning "-3"]
|
|
|
739fb1 |
|
|
|
739fb1 |
module Make_parser (Input : Input) : sig
|
|
|
739fb1 |
- val parse : Input.t -> (Sexp.t, string) Result.t Input.Monad.t
|
|
|
739fb1 |
+ val parse : Input.t -> (Sexp.t, string) result Input.Monad.t
|
|
|
739fb1 |
|
|
|
739fb1 |
- val parse_many : Input.t -> (Sexp.t list, string) Result.t Input.Monad.t
|
|
|
739fb1 |
+ val parse_many : Input.t -> (Sexp.t list, string) result Input.Monad.t
|
|
|
739fb1 |
end
|
|
|
739fb1 |
[@@deprecated "Use Parser module instead"]
|
|
|
739fb1 |
end
|