package odoc
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
OCaml documentation generator
Install
dune-project
Dependency
Authors
Maintainers
Sources
odoc-2.1.1.tbz
sha256=f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd
sha512=1c545c281a7022a167f028fff8cec6fb3f2f82da0881431be74e7a4281c5353ed83bfbdb4d9d9e08af6755dbe3505c052c5e5b58cdeb08c57aed5e89c0f15e91
doc/src/odoc.xref2/utils.ml.html
Source file utils.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(** The [result] type and a bind operator. This module is meant to be opened. *) module ResultMonad = struct (** Re-export for compat *) type ('a, 'b) result = ('a, 'b) Result.result = Ok of 'a | Error of 'b let map_error f = function Ok _ as ok -> ok | Error e -> Error (f e) let of_option ~error = function Some x -> Ok x | None -> Error error let bind m f = match m with Ok x -> f x | Error _ as e -> e let ( >>= ) = bind end (** A bind operator for the [option] type. This module is meant to be opened. *) module OptionMonad = struct (* The error case become [None], the error value is ignored. *) let of_result = function Result.Ok x -> Some x | Error _ -> None let return x = Some x let bind m f = match m with Some x -> f x | None -> None let ( >>= ) = bind end module EitherMonad = struct type ('a, 'b) t = Left of 'a | Right of 'b let return x = Right x let return_left x = Left x let bind m f = match m with Right x -> f x | Left y -> Left y let bind_left m f = match m with Left x -> f x | Right y -> Right y let ( >>= ) = bind let of_option ~left = function Some x -> Right x | None -> Left left let of_result = function Result.Ok x -> Right x | Error y -> Left y end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>