Имам тази функция, която води до списък с низове:
fun get_substitutions1 ([],_) = []
| get_substitutions1 (x::xs,s) = case all_except_option(s,x) of
NONE => [] @get_substitutions1(xs,s)
| SOME lst => lst @get_substitutions1(xs,s)
И тази функция, която приема списък от низове и тип:
fun similar_names(slist,full_name:{first:string,middle:string,last:string})=
let
fun aux(slist,acc)=
case full_name of
{first=a,middle=b,last=c} => case get_substitutions1(slist,a) of
[] => full_name::acc
| x::xs' => full_name:: aux(xs',{first=x,middle=b,last=c}::acc)
in aux(slist,[])
end
И получавам грешка:
Error: operator and operand don't agree. operator domain: string list list * {first:string, last:string, middle:string} list operand: string list * {first:string, last:string, middle:string} list in expression: aux (xs',{first=x,middle=b,last=c} :: acc)
Има ли друг начин?