package batteries
A community-maintained standard library extension
Install
Dune Dependency
Authors
Maintainers
Sources
v3.7.1.tar.gz
md5=d02c4f044e53edca010de46f9139ce00
sha512=99a5afa3604c4cf0c849c670111d617f7f255acb0da043b73ddffdf0e299948bce52516ee31921f269de6088156c4e0a187e0b931543c6819c6b25966b303281
doc/src/batteries.unthreaded/batEither.ml.html
Source file batEither.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
(**************************************************************************) (* *) (* OCaml *) (* *) (* Gabriel Scherer, projet Parsifal, INRIA Saclay *) (* *) (* Copyright 2019 Institut National de Recherche en Informatique et *) (* en Automatique. *) (* *) (* All rights reserved. This file is distributed under the terms of *) (* the GNU Lesser General Public License version 2.1, with the *) (* special exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) type ('a, 'b) t = ##V>=4.12## ('a, 'b) Stdlib.Either.t = Left of 'a | Right of 'b (**) let left v = Left v let right v = Right v let is_left = function | Left _ -> true | Right _ -> false let is_right = function | Left _ -> false | Right _ -> true let find_left = function | Left v -> Some v | Right _ -> None let find_right = function | Left _ -> None | Right v -> Some v let map_left f = function | Left v -> Left (f v) | Right _ as e -> e let map_right f = function | Left _ as e -> e | Right v -> Right (f v) let map ~left ~right = function | Left v -> Left (left v) | Right v -> Right (right v) let fold ~left ~right = function | Left v -> left v | Right v -> right v let iter = fold let for_all = fold let equal ~left ~right e1 e2 = match e1, e2 with | Left v1, Left v2 -> left v1 v2 | Right v1, Right v2 -> right v1 v2 | Left _, Right _ | Right _, Left _ -> false let compare ~left ~right e1 e2 = match e1, e2 with | Left v1, Left v2 -> left v1 v2 | Right v1, Right v2 -> right v1 v2 | Left _, Right _ -> (-1) | Right _, Left _ -> 1
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>