Created
August 10, 2014 16:24
-
-
Save trikitrok/52e9f7e1a8aaa80950a0 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
| fun append(xs, ys) = | |
| case xs of | |
| [] => ys | |
| | head::tail => head::append(tail, ys) | |
| val testAppend1 = append([1, 2, 3, 4], [5, 6, 7]) | |
| (* val testAppend1 = [1,2,3,4,5,6,7] : int list *) | |
| val testAppend2 = append([], [5, 6, 7]) | |
| (* val testAppend2 = [5,6,7] : int list *) | |
| val testAppend3 = append([1, 2, 3, 4], []) | |
| (* val testAppend3 = [1,2,3,4] : int list *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment