package forester
A tool for tending mathematical forests
Install
Dune Dependency
Authors
Maintainers
Sources
2.5.1.tar.gz
md5=b26b6f4e3d14b976c3d5018c97b81b94
sha512=f0c794ed4330485b5255639720ad7201488b77ef947b0736a847fa4f56f93d3f03a22fd2a3319bbe867bab827a4b5ae73b2426a1067911b29fe178d21dd99e73
doc/src/forester.prelude/Printer_kit.ml.html
Source file Printer_kit.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
module type S0 = sig type out val text : string -> out -> unit end module type S = sig include S0 type t = out -> unit val nil : t val iter : ?sep:t -> ('a -> t) -> 'a list -> t val option : ('a -> t) -> 'a option -> t val seq : ?sep:t -> t list -> t val trimmedText : string -> t val space : t end module Kit (P : S0) : S with type out = P.out = struct include P type t = out -> unit let nil : t = fun _ -> () let iter ?(sep = nil) printer xs : t = fun fmt -> let n = List.length xs in xs |> List.iteri @@ fun i x -> if not (i = 0 || i = n) then sep fmt; printer x fmt let option printer = function | None -> nil | Some x -> printer x let seq ?(sep = nil) ps : t = iter ~sep Fun.id ps let trimmedText (txt : string) : t = let txt = String.trim txt in if String.length txt > 0 then text @@ txt else nil let space = text " " end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>