[Haskell] Re: Parameterized Show

Chung-chieh Shan ccshan at post.harvard.edu
Tue Nov 16 10:37:27 EST 2004

George Russell <ger at informatik.uni-bremen.de> wrote in article <4199E0D1.3000206 at informatik.uni-bremen.de> in gmane.comp.lang.haskell.general:
> > 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.

A quick note on this point: the translation I present in that paper
preserves type abstraction, in the sense that you won't be able to
distinguish between an encoded complex number stored as Cartesian
coordinates and an encoded complex number stored as polar coordinates.
Or so I claim (; just to get across the intuitive difference between
a translation into Turing machine code and my translation into System

But more importantly, I don't think the outcome of the translation
is necessarily "rather cumbersome Haskell".  Mark Jones's tutorial
"Functional Programming with Overloading and Higher-Order Polymorphism"
shows many elegant programming examples that would be written in ML
with functors, and whose higher-kinded types fall within the range of
(in other words, are explained by) my translation.  As you suggest, we
should try to bridge Haskell's high-power type and type-class system
with ML's module system, quite possibly to mutual benefit, but dynamic
scoping may not be part of the bridge.  For example, perhaps what you
are getting at is some kind of "import" or "open" mechanism to select a
type-class instance, but of course I am unclear on the details.

Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
A Bush re-election would galvanise the opposition 
Nato is a threat to Europe and must be disbanded

More information about the Haskell mailing list