1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556(* This file is free software, part of containers. See file "license" for more details. *)(** {1 Equality Combinators} *)openCCShims_type'at='a->'a->boolletpoly=Stdlib.(=)letphysical=Stdlib.(==)letint:intt=(=)letstring:stringt=Stdlib.(=)letbool:boolt=Stdlib.(=)letfloat:floatt=Stdlib.(=)letunit()()=trueletreclistfl1l2=matchl1,l2with|[],[]->true|[],_|_,[]->false|x1::l1',x2::l2'->fx1x2&&listfl1'l2'letarrayeqab=letrecauxi=ifi=Array.lengthathentrueelseeqa.(i)b.(i)&&aux(i+1)inArray.lengtha=Array.lengthb&&aux0letoptionfo1o2=matcho1,o2with|None,None->true|Some_,None|None,Some_->false|Somex,Somey->fxyletpairfg(x1,y1)(x2,y2)=fx1x2&&gy1y2lettriplefgh(x1,y1,z1)(x2,y2,z2)=fx1x2&&gy1y2&&hz1z2letmapfeqxy=eq(fx)(fy)(*$Q
Q.(let p = small_list (pair small_int bool) in pair p p) (fun (l1,l2) -> \
CCEqual.(list (pair int bool)) l1 l2 = (l1=l2))
*)letalways_eq__=trueletnever_eq__=falsemoduleInfix=structlet(>|=)xf=mapfxendincludeInfix