12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)type'at='a*'alistlethead(x,_)=xlettail(_,tl)=matchtlwith|[]->None|y::tl->Some(y,tl)letsingletonx=x,[]letiterf(x,tl)=fx;List.iterftlletmapf(x,tl)=letx=fxinlettl=List.mapftlinx,tlletmap2f(x,tl)(x',tl')=letx=fxx'inlettl=List.map2ftltl'inx,tlletmap_headf(x,tl)=fx,tlletpushx=function|None->x,[]|Some(y,tl)->x,y::tlletto_list(x,tl)=x::tlletof_list=function|[]->invalid_arg"NeList.of_list"|x::tl->x,tlletreprx=xletof_reprx=x