typeSet=Int=>Booleandefcontains(s:Set,elem:Int):Boolean=s(elem)defunion(s:Set,t:Set):Set=(x=>contains(t,x)||contains(s,x))defsingletonSet(elem:Int):Set=(x=>x==elem)...vals1=singletonSet(1)vals2=singletonSet(2)vals3=singletonSet(3)//worksvals=List(s1,s2,s3).foldLeft(union(_,_))//errorvals=List(s1,s2,