package core_kernel
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Industrial strength alternative to OCaml's standard library
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.14.2.tar.gz
sha256=66f5353964d35a994ec7fdc88fe60ae5d497ac89a8042786f3e37d9e2202ce4b
md5=ede2f6d22eaa8320f88bac67d41b5cff
doc/src/core_kernel.uopt/uopt.ml.html
Source file uopt.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 28open Core_kernel type 'a t = 'a (* This [Obj.magic] is OK because we never allow user code access to [none] (except via [unsafe_value]. We disallow [_ Uopt.t Uopt.t], so there is no chance of confusing [none] with [some none]. And [float Uopt.t array] is similarly disallowed. *) let none = "Uopt.none" |> (Obj.magic : string -> _ t) let is_none t = phys_equal t none let is_some t = not (is_none t) let invariant invariant_a t = if is_some t then invariant_a t let sexp_of_t sexp_of_a t = if is_none t then [%sexp None] else [%sexp Some (t : a)] let some a = a let value_exn t = if is_none t then failwith "Uopt.value_exn" else t let unsafe_value t = t let to_option t = if is_none t then None else Some t let of_option = function | None -> none | Some a -> some a ;; module Optional_syntax = struct module Optional_syntax = struct let is_none = is_none let unsafe_value = unsafe_value end end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>