package regenerate
Regenerate is a tool to generate test-cases for regular expression engines
Install
dune-project
Dependency
Authors
Maintainers
Sources
regenerate-0.2.tbz
sha256=12495bc3692524dd62e7231e956df4afd7e6b69970deb865e8feafb232e734b2
sha512=b5886b07a9db6f0be8c1b6245aa856538eabf6327cf35b82cecee3dfb9e9fc6e6f3a710753c90919e161b975be2e49df47d5e4c211e6e68dabf677021cbd0df2
doc/src/regenerate.segments/Heap.ml.html
Source file Heap.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
type 'a t = { tree : 'a tree; cmp : 'a -> 'a -> int; merge : 'a -> 'a -> 'a; } (** A pairing tree heap with the given comparison function *) and 'a tree = | Empty | Node of 'a * 'a tree * 'a tree let empty ~cmp ~merge = { tree = Empty; cmp; merge; } let is_empty h = match h.tree with | Empty -> true | Node _ -> false let rec union ({cmp;merge;_} as h) t1 t2 = match t1, t2 with | Empty, _ -> t2 | _, Empty -> t1 | Node (x1, l1, r1), Node (x2, l2, r2) -> let c = cmp x1 x2 in if c = 0 then Node (merge x1 x2, union h r1 r2, union h l1 l2) else if c < 0 then Node (x1, union h t2 r1, l1) else Node (x2, union h t1 r2, l2) let insert h x = { h with tree = union h (Node (x, Empty, Empty)) h.tree } let pop h = match h.tree with | Empty -> raise Not_found | Node (x, l, r) -> x, { h with tree = union h l r }
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>