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

let rec compute = function
    Val v -> v
  | Fun(f, x) -> f (compute x) ;;

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

参考资料 编辑

Type declarations and pattern matching.於2014年1月24日查閱.