package devkit
Development kit - general purpose library
Install
Dune Dependency
Authors
Maintainers
Sources
devkit-1.20210517.tbz
md5=00995ebead339d6ec1ba7859c3fc3a58
sha256=5ad39c7fa1a966a2f0a7f6dbb7e82c787439c73482f5f44b3c9fb54b040d36eb
sha512=8dd3f7d4aaabae9aa9ede13edee2b22214c0d2e2780bb08b2ca8ed588d74fc6d9b1908bb31dfee49c949c7cc425fb98897b8e0f11280070ebd99b965908ea133
doc/src/devkit.core/prelude.ml.html
Source file prelude.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
(** Useful shortcuts *) module U = ExtUnix.Specific module Enum = ExtEnum let ($) f g = fun x -> f (g x) let ($$) f g = fun x y -> f (g x) (g y) let (!!) = Lazy.force external id : 'a -> 'a = "%identity" external identity : 'a -> 'a = "%identity" let flip f x y = f y x let some x = Some x let const x = fun () -> x let apply2 f = fun (x,y) -> f x, f y let printfn fmt = Printf.ksprintf print_endline fmt let eprintfn fmt = Printf.ksprintf prerr_endline fmt let curry f a b = f (a, b) let uncurry f (a,b) = f a b module Fresh(T : sig type t val compare : t -> t -> int end)() = struct type t = T.t let inject = id let project = id let inject_list = id let project_list = id let compare = T.compare let equal a b = T.compare a b = 0 end let (+=) a b = a := !a + b let (-=) a b = a := !a - b let tuck l x = l := x :: !l let cons l x = x :: l let round f = let bot = floor f in if f -. bot < 0.5 then bot else bot +. 1. let atoi name v = try int_of_string v with _ -> Exn.fail "%s %S not integer" name v let call_me_maybe f x = match f with | None -> () | Some f -> f x let () = Lwt_engine.set @@ new Lwt_engines.poll
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>