我正在查看这段代码(前两行是上下文的伪代码)
typ = Void | Bool | Int
type bind = typ * string
let check_binds (kind : string) (binds : bind list) =
List.iter (function
(Void, b) -> raise (Failure ("illegal void " ^ kind ^ " " ^ b))
| _ -> ()) binds;
所以我认为正在发生的事情是有一个名为的列表binds
,并且因为iter
在“”之后的括号内定义的函数List.iter
被应用于binds
.
但是我对函数本身感到困惑。这是我尝试单独写出函数的尝试
function
(Void, b) -> raise (Failure ("illegal void " ^ kind ^ " " ^ b)
| _ -> ()
是什么_ -> ()
意思?