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.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to