`type 'a result = Ok of 'a | Error of 'b` in Pervasives

(Yaron Minsky)

To whoever reads commit messages: the consensus on this change is
weak, which means the opinions can still evolve with experience using
the feature or seeing which external packages it affects. It is not
impossible that the change be reverted before a 4.03 release.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16011 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Gabriel Scherer 2015-04-12 18:44:59 +00:00
parent 90061455e6
commit 19a5d5eb50
4 changed files with 13 additions and 0 deletions

View File

@ -122,6 +122,8 @@ Features wishes:
- GPR#137: add untypeast.ml (in open recursion style) to compiler-libs
(Gabriel Radanne)
- GPR#142: add a CAMLdrop macro for undoing CAMLparam*/CAMLlocal*
- GPR#147: [type 'a result = Ok of 'a | Error of 'b] in Pervasives
(Yaron Minsky)
OCaml 4.02.2:
-------------

View File

@ -210,6 +210,10 @@ external ( := ) : 'a ref -> 'a -> unit = "%setfield0"
external incr : int ref -> unit = "%incr"
external decr : int ref -> unit = "%decr"
(* Result type *)
type ('a,'b) result = Ok of 'a | Error of 'b
(* String conversion functions *)
external format_int : string -> int -> string = "caml_format_int"

View File

@ -206,6 +206,10 @@ external ( := ) : 'a ref -> 'a -> unit = "%setfield0"
external incr : int ref -> unit = "%incr"
external decr : int ref -> unit = "%decr"
(* Result type *)
type ('a,'b) result = Ok of 'a | Error of 'b
(* String conversion functions *)
external format_int : string -> int -> string = "caml_format_int"

View File

@ -966,6 +966,9 @@ external decr : int ref -> unit = "%decr"
(** Decrement the integer contained in the given reference.
Equivalent to [fun r -> r := pred !r]. *)
(** {6 Result type} *)
type ('a,'b) result = Ok of 'a | Error of 'b
(** {6 Operations on format strings} *)