package stdcompat
Compatibility module for OCaml standard library
Install
Dune Dependency
Authors
Maintainers
Sources
20.1.tar.gz
sha512=c482cae49459704100812cb6caa8e8ffa60ffc2414a0ac4c3ec41bdd4203d8299c69be3ab2f7f8764b58b9173e43b89faf70036a19dc5674aa87108ff07c4c60
doc/src/stdcompat/stdcompat__result.ml.html
Source file stdcompat__result.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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
include Stdlib.Result (* type ('a, 'e) t = ('a, 'e) Stdcompat__pervasives.result = | Ok of 'a | Error of 'e let ok v = Ok v let error e = Error e let value r ~default = match r with | Ok v -> v | Error _ -> default let get_ok r = match r with | Ok v -> v | Error _ -> invalid_arg "result is Error _" let get_error r = match r with | Ok _ -> invalid_arg "result is Ok _" | Error e -> e let bind r f = match r with | Ok v -> f v | Error e -> Error e let join r = match r with | Ok v -> v | Error e -> Error e let map f r = match r with | Ok v -> Ok (f v) | Error e -> Error e let map_error f r = match r with | Ok v -> Ok v | Error e -> Error (f e) let fold ~ok ~error r = match r with | Ok v -> ok v | Error e -> error e let iter f r = match r with | Ok v -> f v | Error _ -> () let iter_error f r = match r with | Ok _ -> () | Error e -> f e let is_ok e = match e with | Ok _ -> true | Error _ -> false let is_error e = match e with | Ok _ -> false | Error _ -> true let equal ~ok ~error r r' = match r, r' with | Ok v, Ok v' -> ok v v' | Error e, Error e' -> error e e' | Ok _, Error _ | Error _, Ok _ -> false let compare ~ok ~error r r' = match r, r' with | Ok v, Ok v' -> ok v v' | Ok _, Error _ -> -1 | Error _, Ok _ -> 1 | Error e, Error e' -> error e e' let to_option r = match r with | Ok v -> Some v | Error _ -> None let to_list r = match r with | Ok v -> [v] | Error _ -> [] let to_seq r = match r with | Ok v -> fun () -> Stdcompat__seq.Cons (v, Stdcompat__seq.empty) | Error _ -> Stdcompat__seq.empty *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>