Created
September 17, 2014 21:12
-
-
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
This file contains 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
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