[Haskell-cafe] ordNub
Niklas Hambüchen
mail at nh2.me
Mon Jul 15 08:43:26 CEST 2013
Hey Jason,
would you mind giving a short idea of what the point of Bird's
implementation is / from what properties it is derived?
Also, running the QuickCheck tests you added, it doesn't give the same
output (order) as nub.
On 15/07/13 13:26, Jason Dagit wrote:
> Richard Bird has a book, "Pearls of Functional Algorithm Design" that
> is meant to teach a form of deriving algorithms from the properties we
> ask of them. In this book, he gives a possible derivation of ordNub,
> simply called nub in the book, following the methodology he is
> teaching. He notes in the text that this derivation feels more
> complicated than it ought.
>
> Here is his version: http://lpaste.net/87625
>
> I just sent you a pull request to add that one and S.toList .
> S.fromList that was suggested in this thread. I don't think those two
> implementations are faster than the others but it's nice to have them
> for completeness.
>
> Jason
>
More information about the Haskell-Cafe
mailing list