[Haskell-cafe] A backwards-compatible record proposal

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Aug 19 16:20:44 EDT 2006

Hello Brian,

Saturday, August 19, 2006, 12:21:34 PM, you wrote:

> ie putting a '.' before each field name. The intended meaning is that dotted
> field names do *not* generate top level functions. Instead they allow the
> compiler to generate instance decls as follows, where we've introduced a new
> form of identifier, the dotted id, which behaves as a postfix operator which
> binds more tightly than function application and can also be used as a class
> name (by the compiler only):

>     class (.x) :: a b | a -> b where
>         (.x) :: a -> b

this means that foo.bar should be parsed differently by _lexer_ depending
on is there any .bar field available in current or any imported module

How about omitting '.' and using '#' operation for record access? the
only problem will that '#' should have larger priority than ' '. i.e.
function application. I had proposal on it, but it's too daring -
raise priority of operations when they are written without spaces
around, i.e.

object#call x+y t#field z*2+1

treated as

(object#call) (x+y) (t#field) (z*2+1)

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list