pax_global_header00006660000000000000000000000064134513344000014507gustar00rootroot0000000000000052 comment=5f7f1a4423ca3b9db4b4048d561f31fd6bfd9ab0 result-1.4/000077500000000000000000000000001345133440000126715ustar00rootroot00000000000000result-1.4/.gitignore000066400000000000000000000000401345133440000146530ustar00rootroot00000000000000_build *.install *.merlin _opam result-1.4/CHANGES.md000066400000000000000000000000701345133440000142600ustar00rootroot000000000000001.3 (05/02/2018) ---------------- - Switch to jbuilder result-1.4/LICENSE.md000066400000000000000000000030001345133440000142660ustar00rootroot00000000000000Copyright (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.4/Makefile000066400000000000000000000006131345133440000143310ustar00rootroot00000000000000INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) default: jbuilder build @install install: jbuilder install $(INSTALL_ARGS) uninstall: jbuilder uninstall $(INSTALL_ARGS) reinstall: uninstall reinstall clean: jbuilder clean all-supported-ocaml-versions: jbuilder build --workspace jbuild-workspace.dev .PHONY: default install uninstall reinstall clean all-supported-ocaml-versions result-1.4/README.md000066400000000000000000000003221345133440000141450ustar00rootroot00000000000000Compatibility 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.4/dune000066400000000000000000000003131345133440000135440ustar00rootroot00000000000000(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.4/dune-project000066400000000000000000000000361345133440000152120ustar00rootroot00000000000000(lang dune 1.0) (name result) result-1.4/jbuild-workspace.dev000066400000000000000000000005041345133440000166350ustar00rootroot00000000000000;; Install the following opam switches, copy this file as ;; jbuild-workspace and run: ;; ;; $ jbuilder build @install ;; ;; This will build result against all these version of OCaml (context ((switch 4.02.3))) (context ((switch 4.03.0))) (context ((switch 4.04.2))) (context ((switch 4.05.0))) (context ((switch 4.06.0))) result-1.4/pkg/000077500000000000000000000000001345133440000134525ustar00rootroot00000000000000result-1.4/pkg/pkg.ml000066400000000000000000000000561345133440000145660ustar00rootroot00000000000000#use "topfind" #require "topkg-jbuilder.auto" result-1.4/result-as-alias.ml000066400000000000000000000001071345133440000162270ustar00rootroot00000000000000type nonrec ('a, 'b) result = ('a, 'b) result = Ok of 'a | Error of 'b result-1.4/result-as-newtype.ml000066400000000000000000000000561345133440000166340ustar00rootroot00000000000000type ('a, 'b) result = Ok of 'a | Error of 'b result-1.4/result.opam000066400000000000000000000005651345133440000150730ustar00rootroot00000000000000opam-version: "1.2" maintainer: "opensource@janestreet.com" authors: ["Jane Street Group, LLC "] homepage: "https://github.com/janestreet/result" dev-repo: "https://github.com/janestreet/result.git" bug-reports: "https://github.com/janestreet/result/issues" license: "BSD3" build: [["dune" "build" "-p" name "-j" jobs]] depends: ["dune" {build}] result-1.4/which_result.ml000066400000000000000000000003551345133440000157260ustar00rootroot00000000000000let () = 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 "result-as-alias.ml" in print_string file