Skip to content

Instantly share code, notes, and snippets.

@akimacho
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akimacho/3c3c3154279f083f703d to your computer and use it in GitHub Desktop.
Save akimacho/3c3c3154279f083f703d to your computer and use it in GitHub Desktop.
2つの組を用いた構文
(* p.p.51 - 54 *)
(* パターンマッチの構文を用いた場合 *)
# let add1 pair = match pair with
(a, b) -> a + b ;;
val add : int * int -> int = <fun>
(* 引数にパターンを書いた場合 *)
# let add2 (a, b) = a + b ;;
val add2 : int * int -> int = <fun>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment