Created
November 13, 2014 10:37
-
-
Save sugitach/de9960abe1bd0b189177 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(* 目的:ふたつのリストを受け取って長さが同じかどうかを返す *) | |
(* equal_length : a' list -> b' list -> bool *) | |
let rec equal_length lst1 lst2 = | |
match lst1 with | |
[] -> (match lst2 with [] -> true | _::_ -> false) | |
| f1::r1 -> (match lst2 with [] -> false | f2::r2 -> equal_length r1 r2) | |
(* テスト *) | |
let test1 = equal_length [] [] = true | |
let test2 = equal_length [1; 2; 3] ["a";"b";"c"] = true | |
let test3 = equal_length [] [1;2;3;4] = false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment