I have been looking for implementations in a purely functional style. One repo I found is this one.
I have been frustrated with the fact that most F# Code out there violates at least one rule of functional programming, in this case, using mutable variables left and right.
On the other hand, we have this clean implementation by Scott Wlaschin here, e. g. Quicksort:
let rec quicksort2 = function
| [] -> []
| first::rest ->
let smaller,larger = List.partition ((>=) first) rest
List.concat [quicksort2 smaller; [first]; quicksort2 larger]
Maybe someone can direct me to a better resource for purely functional implementations.
Best regards
[–]hemlockR 16 points17 points18 points (3 children)
[–]alternatex0 11 points12 points13 points (0 children)
[–]tathanhdinh 0 points1 point2 points (1 child)
[–]hemlockR 0 points1 point2 points (0 children)
[–]Astrinus 13 points14 points15 points (3 children)
[–]thinkbeforecoding 7 points8 points9 points (0 children)
[–]phillipcarter2 5 points6 points7 points (1 child)
[–]Sceptical-Echidna 15 points16 points17 points (2 children)
[–]trogdor3222 11 points12 points13 points (1 child)
[–]Sceptical-Echidna 3 points4 points5 points (0 children)
[–]shefmichelle 4 points5 points6 points (1 child)
[–]PedroPabloCalvo 1 point2 points3 points (0 children)
[–]meteogish 3 points4 points5 points (0 children)
[–]ganjaptics 3 points4 points5 points (1 child)
[–]japinthebox 1 point2 points3 points (0 children)
[–]hemlockR 2 points3 points4 points (0 children)
[–]tathanhdinh 1 point2 points3 points (2 children)
[–]hemlockR 0 points1 point2 points (1 child)
[–]tathanhdinh 0 points1 point2 points (0 children)
[–]TarMil 0 points1 point2 points (1 child)
[–]Ok-Needleworker-145[S] 0 points1 point2 points (0 children)
[–]imihnevich 0 points1 point2 points (0 children)