用户:Gqqnb/OCaml入门教程/模式匹配

维基教科书,自由的教学读本
let rec compute = function
    Val v -> v
  | Fun(f, x) -> f (compute x) ;;

这种情况下,被用于匹配的参数是匿名的,从而也无法标示该参数的类型。

参考资料[编辑]

Type declarations and pattern matching.于2014年1月24日查阅.