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.utilsLib/product.ml.html
Source file product.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 41module type Elt = sig type t val to_string : t -> string end module Make (E : Elt) = struct type tuple = E.t list type t = tuple list let list_to_tuple t = t let tuple_to_list t = t let tuple_to_string t = Printf.sprintf "(%s)" (Utils.string_of_list ", " E.to_string t) let to_list p = p let to_string p = Utils.string_of_list "\n" tuple_to_string p let extend_relation value tuples acc = List.fold_left (fun new_tuples tuple -> (value :: tuple) :: new_tuples) acc tuples let cartesian_product values tuples = List.fold_left (fun new_tuples value -> extend_relation value tuples new_tuples) [] values let rec product_aux arity values tuples = if arity = 0 then tuples else let new_tuples = cartesian_product values tuples in product_aux (arity - 1) values new_tuples let product arity values = let one_ary_tuples = List.map (fun elt -> [ elt ]) values in product_aux (arity - 1) values one_ary_tuples let fold f start product = List.fold_left f start product end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>