Created
October 14, 2020 13:49
-
-
Save hovsater/9c30c1f632d09a686575ad14dcb014fb 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
(* Write a function append : int list -> int list -> int list such that | |
append l1 l2 is the concatenation of l1 and l2. *) | |
let rec append l1 l2 = | |
let rec rev acc = function | |
| [] -> acc | |
| x::xs -> rev (x::acc) xs | |
in | |
let rec aux l = function | |
[] -> l | |
| x::xs -> aux (x::l) xs | |
in | |
aux l2 (rev [] l1) ;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment