これはOCamlの表記法に関する質問です。
機能をテストしようとしています
let rec add (x : 'a) (l : 'a set) : bool =
begin match l with
| [] -> []
| hd :: rest -> if x = hd then rest else (hd :: (add x rest))
end
私のテストケースは
let test () : bool =
add (3 [1; 2; 4]) = [1; 2; 3; 4]
;; run_test "add 3 [1; 2; 4]" test
「この式は関数ではないため、適用できません」というエラーが表示されます
私の表記に何か問題がありますか?