package acgtk
Abstract Categorial Grammar development toolkit
Install
Dune Dependency
Authors
Maintainers
Sources
acgtk-1.5.3.tar.gz
sha256=2743321ae4cc97400856eb503a876cbcbd08435ebc750276399a97481d001d41
md5=04c1e14f98e2c8fd966ef7ef30b38323
doc/src/acgtkLib.utilsLib/focused_list.ml.html
Source file focused_list.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
module Focused_list = struct type 'a t= List_zip of ('a list*'a*'a list) (** This type aims to implement a zipper for lists. The context is the first parameter. It represents the list of the elements {e in reverse order} that has been traversed to reach the focused element (the second parameter). The last element is the remaining elements of the list. *) exception Empty_list exception End_of_list let init = function | [] -> raise Empty_list | h::tl -> List_zip([],h,tl) let forward = function | List_zip (c,f,h::tl) -> List_zip(f::c,h,tl) | List_zip (_,_,[]) -> raise End_of_list let backward = function | List_zip (h::tl,f,r) -> List_zip(tl,h,f::r) | List_zip ([],_,_) -> raise End_of_list let rec fold f acc = function | List_zip ((_,_,[]) as focus) -> f acc focus | List_zip ((_,_,_) as focus) as lst -> fold f (f acc focus) (forward lst) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>