Created
February 28, 2017 15:29
-
-
Save basus/c6c20c5cea502180ef9fdf896f2884dc 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
let append xs ys = | |
let rec helper xs ys acc = | |
match xs,ys with | |
| [], [] -> List.rev acc | |
| [], y::ys' -> helper xs ys' ( y::acc ) | |
| x::xs', ys -> helper xs' ys ( x::acc ) in | |
helper xs ys [] | |
append [1;2;3] [4;5];; | |
append [] [4;5];; | |
append [1;2] []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment