package ppxlib
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Standard infrastructure for ppx rewriters
Install
dune-project
Dependency
Authors
Maintainers
Sources
a6fadbd212f3cd7d5d8dcfefc46c884f710fedc0.tar.gz
sha256=25e81f2085ad19688f7056c6df49ca48b3df4cea8304ba3be2550e172d59bfec
sha512=cfdaa06fd32d206f72de05a5289d33ec85fa6bdf7c5be7c85874a16d9e154cdc080465453b60fe7f6c01589eb92e4296b18067413ac2d8dec47b9539f55e301e
doc/src/ppxlib.astlib/stdlib0.ml.html
Source file stdlib0.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 47module String = struct include String let is_prefix t ~prefix = let rec is_prefix_from t ~prefix ~pos ~len = pos >= len || Char.equal (String.get t pos) (String.get prefix pos) && is_prefix_from t ~prefix ~pos:(pos + 1) ~len in String.length t >= String.length prefix && is_prefix_from t ~prefix ~pos:0 ~len:(String.length prefix) end module Option = struct include Option module Op = struct let ( let* ) = Option.bind let ( let+ ) o f = Option.map f o end module List = struct let map ~f l = let rec aux acc l = match l with | [] -> Some (List.rev acc) | hd :: tl -> ( match f hd with None -> None | Some x -> aux (x :: acc) tl) in aux [] l end end module List = struct include List (** [without_first l ~pred] return [Some (elm, l')] where [elm] is the first element of [l] that satisfies [pred] and [l'] is [l] without [elm] or [None] if no element of [l] satisfies [pred]. *) let without_first list ~pred = let rec aux seen = function | [] -> None | hd :: tl when pred hd -> Some (hd, List.rev_append seen tl) | hd :: tl -> aux (hd :: seen) tl in aux [] list end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>