StricterLabelledFieldSyntax
Isaac Dupree
ml at isaac.cedarswampstudios.org
Sun Jul 26 13:45:54 EDT 2009
Jon Fairbairn wrote:
> 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,
we already know which record type it is, because record fields don't
have disambiguation.
If it's (data D = D { x, y :: Int }) then (x :: D -> Int) and we would
have (({x=42}) :: D -> D).
Or (data E n = E1 { ex, ey :: n } | E2 { ey :: n } | E3 {ex :: n}), (ey
:: E n -> n), (({ex=42}) :: Num n => E n -> E n), but probably not ever
allowing to change (E n1 -> E n2) even if it changes both ex and ey.
I think it wouldn't be a terrible syntax, ({...}), kind of like infix
operators can be made into functions like (+). If you wanted to make a
proposal for such an extension.
-Isaac
More information about the Haskell-prime
mailing list