Я знаю, как работает код, за исключением переменной х здесь: НЕКОТОРЫХ у => НЕКОТОРЫХ (х :: у)Как именно этот код работает?
fun same_string(s1 : string, s2 : string) =
s1 = s2
fun all_except_option (str, xs) =
case xs of
[] => NONE
| (x::xs') => case (same_string(str,x)) of
true => SOME xs'
| false => case all_except_option(str,xs') of
NONE => NONE
| SOME y=> SOME (x::y)
Как "х" держит [ "а", "б "], когда вы возвращаете НЕКОТОРЫЕ (x :: y)?
val test1 = all_except_option("string", ["a","b","string","c"]) = SOME ["a","b","c"]