pax_global_header00006660000000000000000000000064136234347370014526gustar00rootroot0000000000000052 comment=b0b9cd6e9cce8d2b7ad11127a6135540ec3f8a92 result-1.5/000077500000000000000000000000001362343473700127115ustar00rootroot00000000000000result-1.5/.gitignore000066400000000000000000000000401362343473700146730ustar00rootroot00000000000000_build *.install *.merlin _opam result-1.5/CHANGES.md000066400000000000000000000003751362343473700143100ustar00rootroot000000000000001.5 (17/02/2020) ---------------- - Make Result an alias of Stdlib.Result on OCaml >= 4.08. 1.4 (27/03/2019) ---------------- - Switch to Dune. - Do not refer to Pervasives; it is deprecated. 1.3 (05/02/2018) ---------------- - Switch to jbuilder. result-1.5/LICENSE.md000066400000000000000000000030001362343473700143060ustar00rootroot00000000000000Copyright (c) 2015, Jane Street Group, LLC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Jane Street Group nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. result-1.5/Makefile000066400000000000000000000004161362343473700143520ustar00rootroot00000000000000INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) default: dune build @install install: dune install $(INSTALL_ARGS) uninstall: dune uninstall $(INSTALL_ARGS) reinstall: uninstall reinstall clean: dune clean .PHONY: default install uninstall reinstall clean result-1.5/README.md000066400000000000000000000003221362343473700141650ustar00rootroot00000000000000Compatibility Result module. Projects that want to use the new result type defined in OCaml >= 4.03 while staying compatible with older version of OCaml should use the `Result` module defined in this library. result-1.5/dune000066400000000000000000000003131362343473700135640ustar00rootroot00000000000000(library (name result) (public_name result) (modules result)) (rule (with-stdout-to selected (run %{ocaml} %{dep:which_result.ml} %{ocaml_version}))) (rule (copy# %{read:selected} result.ml)) result-1.5/dune-project000066400000000000000000000000361362343473700152320ustar00rootroot00000000000000(lang dune 1.0) (name result) result-1.5/result-as-alias-4.08.ml000066400000000000000000000001371362343473700166410ustar00rootroot00000000000000include Stdlib.Result type ('a, 'b) result = ('a, 'b) Stdlib.Result.t = Ok of 'a | Error of 'b result-1.5/result-as-alias.ml000066400000000000000000000001511362343473700162460ustar00rootroot00000000000000type nonrec ('a, 'b) result = ('a, 'b) result = Ok of 'a | Error of 'b type ('a, 'b) t = ('a, 'b) result result-1.5/result-as-newtype.ml000066400000000000000000000001201362343473700166440ustar00rootroot00000000000000type ('a, 'b) result = Ok of 'a | Error of 'b type ('a, 'b) t = ('a, 'b) result result-1.5/result.opam000066400000000000000000000012001362343473700150760ustar00rootroot00000000000000opam-version: "2.0" maintainer: "opensource@janestreet.com" authors: ["Jane Street Group, LLC "] homepage: "https://github.com/janestreet/result" dev-repo: "git+https://github.com/janestreet/result.git" bug-reports: "https://github.com/janestreet/result/issues" license: "BSD-3-Clause" build: [["dune" "build" "-p" name "-j" jobs]] depends: [ "ocaml" "dune" {>= "1.0"} ] synopsis: "Compatibility Result module" description: """ Projects that want to use the new result type defined in OCaml >= 4.03 while staying compatible with older version of OCaml should use the Result module defined in this library.""" result-1.5/which_result.ml000066400000000000000000000004741362343473700157500ustar00rootroot00000000000000let () = let version = Scanf.sscanf Sys.argv.(1) "%d.%d" (fun major minor -> (major, minor)) in let file = if version < (4, 03) then "result-as-newtype.ml" else if version < (4, 08) then "result-as-alias.ml" else "result-as-alias-4.08.ml" in print_string file