Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Last active December 10, 2015 23:48
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 adilakhter/4511771 to your computer and use it in GitHub Desktop.
Save adilakhter/4511771 to your computer and use it in GitHub Desktop.
let rec zipTwo (x:int list) (y: int list) : ((int*int) list) option =
match x,y with
| ([], []) -> Some []
| (xhd::xtl, yhd::ytl) ->
match zipTwo xtl ytl with
| None -> None
| Some lst -> Some ((xhd,yhd)::lst)
| (_,_) -> None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment