Hi Jeff.

> > 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".

> Just as a sanity check, following an augmented proposal "A" where we can also
> annotate the return type as well, consider these:
> 
>     f :: a -> (a -> a) -> a
>     f x = \g -> (g :: a -> a) x
> 
>     f (x :: a) :: (a -> a) -> a = \g -> (g :: a -> a) x
> 
> Which of these two is correct, and why?  Why not both?

Under "A+B", these would be equivalent.  Under "A++" (Mark's original
"A", only, plus the return types), the second of these is "correct"
(assuming a restricted interpretation of "a" is what was intended), but
in the first, the a's in sig and body are bound quite separately, so the
local type annotation would be too general.

Slainte,
Alex.


Reply via email to