
9 Jul
2009
9 Jul
'09
2:20 a.m.
Interesting. Can you make the definition of quicksort non-recursive, too? Perhaps with help of a bootstrapping combinator like the one implicit in the approach I have given earlier?
treeSort = bootstrap partitionOnMedian bootstrap f = Fix . helper . f where helper = fmap (Fix . helper . f)
partitionOnMedian :: forall a. (Ord a) => (S.Seq a) -> BTreeRaw a (S.Seq a)
Extra points if you can give 'bootstrap' or an equivalent in terms of existing Haskell combinators. Matthias.