1234567891011121314151617181920212223242526272829303132333435363738394041(*****************************************************************************
Liquidsoap, a programmable audio stream generator.
Copyright 2003-2023 Savonet team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, fully stated in the COPYING
file at the root of the liquidsoap distribution.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*****************************************************************************)(* Immutable fast hash *)type('a,'b)t=('a*'b)listletis_emptyh=h=[]letbindingsh=hletempty=[]letcardinal=List.lengthletfoldfnhr=List.fold_left(funr(k,v)->fnkvr)rhletfind=List.assocletfind_opt=List.assoc_optletmem=List.mem_assocletmapifn=List.map(fun(k,v)->(k,fnkv))letmapfn=List.map(fun(k,v)->(k,fnv))letfilterfn=List.filter(fun(k,v)->fnkv)letaddkvh=(k,v)::List.remove_assockhletiterfn=List.iter(fun(k,v)->fnkv)letfor_allfn=List.for_all(fun(k,v)->fnkv)letexistsfn=List.exists(fun(k,v)->fnkv)