Last active
August 29, 2015 14:16
-
-
Save akimacho/3c3c3154279f083f703d to your computer and use it in GitHub Desktop.
2つの組を用いた構文
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 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