Thomas Harke wrote:
> Marcin 'Qrczak' Kowalczyk wrote:
> > [...] GHC developers decided that it is more convenient than
> > confusing and permitted to spell type synonyms in instance
> > definitions. I agree with it.
> Now I'm confused.  Do you mean I *can* do this in GHC?  But the
> Haskell Report (4.3.2) says this may not be done.

But GHC does it anyway (probable rationale: This doesn't break any
pure Haskell 98 programs). Perhaps it should only be allowed with
-fglasgow-exts.

> > [...] You don't ask for instances for type synonyms; you ask
> > for partial application of type synonyms.
> This I don't follow.

`State sī in your example has kind * -> *, not *, so it isn't a type.

> > It is indeed not permitted, and AFAIK even if it would have well
> > defined semantics it would make the type system undecidable.

> This is the sort of answer I was expecting.  Can anybody confirm
> this and give a simple concrete example of a problem?

See the last part of Mark Jones' mail

   http://www.mail-archive.com/haskell@haskell.org/msg05356.html

> [...] Yes, but when you try to explain these generic monads
> things start to get hairy.

Just wait until you try to explain monad transformers to mere
mortals...  :-}

> For instance, of the following two snippets of code the former
> is IMHO a lot easier to motivate/understand, basically because
> the second is cluttered with constructors, field accessors and
> variables. [ example deleted ]

But this is really a matter of taste. I'm a real friend of
variable-free definitions, but from time to time (e.g. in this
example) it's IMHO much easier to see what's going on *with*
explicit variables and the (un-)wrapping.

Cheers,
   Sven
-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne

Reply via email to