1234567891011121314151617181920212223242526272829303132moduleFocused_list=structtype'at=List_zipof('alist*'a*'alist)(** 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. *)exceptionEmpty_listexceptionEnd_of_listletinit=function|[]->raiseEmpty_list|h::tl->List_zip([],h,tl)letforward=function|List_zip(c,f,h::tl)->List_zip(f::c,h,tl)|List_zip(_,_,[])->raiseEnd_of_listletbackward=function|List_zip(h::tl,f,r)->List_zip(tl,h,f::r)|List_zip([],_,_)->raiseEnd_of_listletrecfoldfacc=function|List_zip((_,_,[])asfocus)->faccfocus|List_zip((_,_,_)asfocus)aslst->foldf(faccfocus)(forwardlst)end