Hi Mark (and all).

> I think the way that Hugs 1.3c handles it would meet your goals.  All that
> it requires is a strict extension to the syntax for patterns to allow type
> annotations.  These can be useful in their own right, but also can be
> applied to problems like the one that you gave:
> 
>   f :: [a] -> a -> [a]
>   f ((x::a):xs) y = g y
>          where
>            g :: a -> [a]
>            g q = [x,q]

AKA "Proposal A" in SPJ's recent message on this topic:

http://www.cs.chalmers.se/~rjmh/Haskell/Messages/Display.cgi?id=274

I think "A" is fine, it's "B" (and hence, SPJ's Composite Motion, A+B)
that worries me, for the reasons I alluded to.  If "beefed up A"
does the job, I'm equally happy as with a more conservation syntax for
"B".


> In recent discussions with Simon, we discovered that
> this approach also works better if existential types are included in the
> language.

That makes at least intuitive sense to me (a "monomorphic type varible"
_is_ some sort of existential quantification, isn't it, in at least some
vague, hand-wavey way?) -- could you expand a little on the details of
this, though?

Slainte,
Alex.


Reply via email to