Skip to content

Instantly share code, notes, and snippets.

@basus
Created February 28, 2017 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basus/c6c20c5cea502180ef9fdf896f2884dc to your computer and use it in GitHub Desktop.
Save basus/c6c20c5cea502180ef9fdf896f2884dc to your computer and use it in GitHub Desktop.
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