[Haskell] Re: Parameterized Show

George Russell ger at informatik.uni-bremen.de
Tue Nov 16 06:13:21 EST 2004


oleg at pobox.com wrote (snipped):
> The running example includes an ORD class -- which is like the Ord
> class but can be parameterized by a comparison function, so to
> speak.

This is precisely the problem.  Rather than being able to use the existing
functions, you have to haul around an extra discriminator value.  You cannot
use for example Data.Set, instead you have to use a more complicated class
which knows about this discriminator value.

I find this especially frustrating because Data.Set already hauls around
a dictionary telling it how to order things, and it is annoying that because
we can't manipulate this directly we have to add extra data.

> Ken Shan's paper, the above and the following messages
> 	http://www.haskell.org/pipermail/haskell/2004-September/014515.html
> 
> argue that Haskell already has the full power of Standard ML's
> structures and functors (and not only generative but applicative
> functors as well).

So does a Turing machine for that matter.  The fact that you can translate
Standard ML's functors into rather cumbersome Haskell proves nothing.



More information about the Haskell mailing list