Skip to content

Instantly share code, notes, and snippets.

@Shibe
Created June 19, 2017 08:33
Show Gist options
  • Save Shibe/438ca786d62274081a806fbb0df78555 to your computer and use it in GitHub Desktop.
Save Shibe/438ca786d62274081a806fbb0df78555 to your computer and use it in GitHub Desktop.
let rec zip list1 list2 =
match list1, list2 with
| [], [] -> []
| head1 :: tail1, head2 :: tail2 -> (head1, head2) :: zip tail1 tail2
| _ -> failwith "Incorrect input"
[<EntryPoint>]
let main argv =
printfn "%A" (zip [1;2;3] [4;5;6])
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment