Skip to content

hegge/tmp-qsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmp-qsort

Compile time quicksort

Metaprogramming allows us to show off our cleverness. Obviously, that is to be avoided. -- Bjarne Stroustrup, The C++ Programming Language, fourth edition.

Have you ever started learning Haskell because you wanted to understand C++ template metaprogramming? And then you came across some variant of quicksort in Haskell, like

quicksort :: Ord a => [a] -> [a]
quicksort []     = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
    where
        lesser  = filter (< p) xs
        greater = filter (>= p) xs

and wondered what that would look like in TMP?

References

About

Compile time quicksort

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages