Fergus Henderson quoting Simon P J:

> > ... Sergey essentially wants to
> > replace the entire prelude, special syntax and all.  There are lots
> > of small but important things under the heading of special syntax:
> >
> >       Explicit lists [a,b,c]
> >       List comprehensions
> >       Numeric constants (1 means 'fromInteger 1')
> >       do notation
> >
> > Here is an idea ...

> >       import {-# SYNTAX #-} MyPrelude
> >
> > Here, I've expressed it as a pragma.  ... 
> > I wonder what other people think?
> 
> I like this proposal.  I'm not rapt about the particular syntax you've
> chosen for it, though.  I think I'd prefer something that was part
> of the language syntax proper, rather than a pragma. 

===

My opinion: Anything, any syntax, any protocol, but *DO IT PLEASE*!
And convince the Hugs people to include that as well.

I don't want to replace the entire Prelude. But I work with 
non-standard (*) mathematical objects, and this will continue for 
some time. 

In contrast with Sergey, I don't want to reconstruct the full-fledged
formal algebra, but I could mention here several dozens specific
datatypes which have some mathematical/structural "personalities"
needing some fundamental support from the compiler. (From audio-streams
and procedural graphical objects: 3d models and textures; differential
forms, lazy state transformers pretending to be normal arithmetical
functions, ... up to Feynman diagrams...)

The suggestion of M. Kowalczyk that Num should be the superclass of
AdditiveBlahBlah is - as I see it - erroneous. It won't help.


In Paris I had the honour of exchanging a few words with Simon Peyton
Jones, and his comment on this part of my checklist was (more or
less): "So, you want that the compiler recognize that explicit numeric
constants should be *automatically* converted using *your*, user-defined
fromInt, fromDouble, etc."

EXACTLY. This is also what Sergey wants. I don't know whether this
would imply some hidden inefficiency, but I don't care. Other things
are more important. You might know that the exponentiation, or taking
a logarithm has some structural meaning, for example in the theory of
graphs. (The differentiation as well; it is related to labelling).
Yet, the current Haskell hierarchy forces you to declare the concerned
data structures as belonging to "Floating", which at the beginning I
found annoying, and now I consider very harmful.

Down with the slavery imposed by the Standard Prelude!


Jerzy Karczmarczuk
Caen, France. 

===


(*) Sorry, this is not true. Standard as potatoes, just a bit non-
    trivial...

Another three euro-cents:
Monsieur Kowalczyk rides again:

> Standard Prelude has to be present anyway. You cannot construct
> a reasonable implementation of Char from the thin air, and also
> fromInteger must use a known to the compiler Integer type.

> If they cannot be redefined, I see no reason to be able to export
> and import them. And I think that they should not be redefined;...

Perhaps we should not confuse the syntactic (and attributed) 
recognition of constants by the compiler with their "lifting"
to user-specified datatypes. When you write "sialaBabaMak" 
assigned within a declaration to a variable of your special class
in C++, the compiler launches *this constructor YOU wish to be
used*, and I don't see why we cannot have the same facility in
Haskell. 

You write that you are happy with the Standard Prelude. May Allah
be with you. But show us please some of your Haskell programs, OK?!

Reply via email to