Skip to content

Instantly share code, notes, and snippets.

@chribben
Created September 17, 2014 21:12
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 chribben/09600f001157c3611da5 to your computer and use it in GitHub Desktop.
Save chribben/09600f001157c3611da5 to your computer and use it in GitHub Desktop.
Using the function pattern matching construct to bind the tuple from List.partion to ltx and gtx in a forward pipe
let rec quickSort l =
match l with
| [] -> []
| x::xs -> xs |> List.partition (fun y -> y < x) |> function (ltx,gtx) -> (quickSort ltx)@x::quickSort gtx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment