Created
May 2, 2014 15:56
-
-
Save xandkar/39be6f992b992260370b 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
| type 'a list = Nil | Cons of 'a * 'a list;; | |
| type 'a list = Nil | Cons of 'a * 'a list | |
| # | |
| let l = Cons (1, Nil);; | |
| val l : int list = Cons (1, Nil) | |
| # | |
| let hd, tl = match l with Cons (hd, tl) -> hd, tl;; | |
| Warning 8: this pattern-matching is not exhaustive. | |
| Here is an example of a value that is not matched: | |
| Nil | |
| val hd : int = 1 | |
| val tl : int list = Nil | |
| # | |
| let hd, tl = match tl with Cons (hd, tl) -> hd, tl;; | |
| Warning 8: this pattern-matching is not exhaustive. | |
| Here is an example of a value that is not matched: | |
| Nil | |
| Exception: "Match_failure //toplevel//:37:13". | |
| # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment