Skip to content
/ either Public

Compatibility module for Either in OCaml 4.12

License

Notifications You must be signed in to change notification settings

mirage/either

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compatibility Either module

OCaml-CI Build Status Documentation

Projects that want to use the Either module defined in OCaml 4.12.0 while staying compatible with older versions of OCaml should use this library instead. On OCaml versions 4.12 and above, this library defines an alias Either to the standard library's definition of the module. Otherwise, it provides an equivalent definition of Either.

Depending on this library

Opam libraries depending on this module are encouraged to use a conditional dependency:

depends: [
  ("ocaml" {>= "4.12.0"} | "either")
]

This ensures that any dependencies of your library that don't need pre-4.12 compatibility will never transitively depend on either.


Acknowledgements

This repository structure is mostly copied from JaneStreet/result, which provides a compatibility result type. Thanks to the OCaml maintainers for their improvements to the standard library.