package acgtk
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Abstract Categorial Grammar development toolkit
Install
dune-project
Dependency
Authors
Maintainers
Sources
acg-2.2.0-20251107.tar.gz
sha512=07f391d052090bb70c10ec511fdc53af764954cbe1c30093778984c5ed41a4327573fdac0890c6fd619ff9827725572eb7b8a7545bd8ccb7f5bddb84d2d7f7cc
doc/src/acgtk.containers/treeContext.ml.html
Source file treeContext.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 52open UtilsLib module Tree = struct type 'a tree = Node of ('a * 'a tree list) let rec pp ppf fmt t = match t with | Node (v, []) -> Format.fprintf fmt "@[%a@]" ppf v | Node (v, children) -> Format.fprintf fmt "@[%a @[<v>%a@]@]" ppf v (PPUtils.pp_list ~sep:"@;" (fun fmt t -> Format.fprintf fmt "@[-- @[%a@]@]" (pp ppf) t)) children let rec fold_depth_first ((transform, apply) as f) t = match t with | Node (v, []) -> transform v | Node (v, children) -> List.fold_left (fun acc child -> apply acc (fold_depth_first f child)) (transform v) children let label (Node (a, _)) = a end module TreeContext = struct type 'a t = | Top | Zipper of ('a * 'a Tree.tree ListContext.focused_list * 'a t) type 'a focused_tree = 'a t * 'a Tree.tree type direction = | Up | Down [@warning "-unused-constructor"] | Right [@warning "-unused-constructor"] exception Move_failure of direction let up = function | Top, _ -> raise (Move_failure Up) | Zipper (label, (elders, youngers), z), t -> z, Tree.Node (label, ListContext.zip_up elders (t::youngers)) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>