This repository gathers most of the ideas and case studies presented in a great paper All Sorts of Permutations (Functional Pearl).
The code is split into two directories: src
and notebooks
.
Sorters.hs
contains default implementations for 5 standard sorting algorithms, namely: insertion sort, selection sort, bubble sort, quick sort, merge sortSortersM.hs
contains monadic counterpartsPredicates.hs
contains standard nondeterministic binary boolean predicate and its consistent version
RunSorters.ipynb
presents usage of the sorters and a way for testing themSimpleND.ipynb
presents main the fundamental concept behind the paperSelectSort.ipynb
,Quicksort.ipynb
andBubbleSort.ipynb
present detailed case studies on corresponding algorithms
The notebooks were created thanks to IHaskell. The Set
monad was taken from set-monad package.