StricterLabelledFieldSyntax

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Sun Jul 26 04:21:06 EDT 2009


Ian Lynagh <igloo at earth.li> writes:
> http://hackage.haskell.org/trac/haskell-prime/wiki/StricterLabelledFieldSyntax

I approve of the principle -- the binding level is confusing, but I
would far rather make a bigger change, so that rather than being
confusable with the binding level of function application, it /has/ the
binding level of function application. ie, instead of a{x=42} one would
have to write {x=42}a, and "f {x=42} a" would parse as "(f {x=42}) a" --
and be an error because labelled field assignments aren't currently
proper functions (but under this change they could be thought of as
a restricted kind of function).

This would allow a future change that made them first class citizen;
"{x=42}" would have type something like (Num a => forall D. D{x::a} ->
D{x::a}) (if you can work out the intent of a syntax made up on the spur
of the moment). Working out the ramifications of a type system that
allowed that is a job for later, but it would be worthwhile to make it
possible.


Would it be proper to create a counterproposal for this syntax?
ReversedLabelledFieldSyntax?

-- 
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk




More information about the Haskell-prime mailing list