[Haskell-cafe] Some thoughts on Type-Directed Name Resolution

AntC anthony_clayden at clear.net.nz
Tue Feb 7 01:41:48 CET 2012


Richard O'Keefe <ok <at> cs.otago.ac.nz> writes:

> 
> 
> On 4/02/2012, at 12:13 AM, Gábor Lehel wrote:
> > 
> > All of this said, record.field is still the most readable, intuitive,
> > and familiar syntax for selecting a field from a record that I know
> > of.
> 
> Having learned COBOL and Algol 68 before Haskell was dreamed of,
> I regard
> 
> 	field OF record
> 
> as the most readable, intuitive, and familiar syntax.  Given our
> background in reading natural language text, most of us probably
> thought once upon a time that '.' was the most readable, intuitive,
> and familiar syntax for terminating a statement, and in COBOL, NDL,
> and Smalltalk, it _is_.  There's certainly nothing about a dot
> that suggests field selection, *unless* you happen to be familiar
> with a programming language that does it that way. ...
> 
Richard, now you're just being playful.

Database access languages used record.field since COBOL days (well certainly 
before SQL in 1969).

    Assembler and linker languages often allowed dots within names.
    I presume IPv4 dot-decimal comes from this.

I think the use of dot comes from section and sub-section numbering in large 
documents. I have no idea when that dates from, but off the top of my head:

    Principia Mathematica, Russell and Whitehead 1910
    Tractatus Logico-Philosophicus, Wittgenstein, 1918

(Admittedly Princ Math also uses dot (infix operator) as logical product. As 
well, there's a dot separator between a quantifier's list of bound variables 
(upside-down A, backwards E) and the bound term. Church's lambda notation 
similarly uses a dot to separate the bound variables.)

There is one 'odd man out' when it comes to dot notation:
A few little-known programming languages have for some reason bucked the well-
established convention of small circle for function composition.

There's certainly nothing about a dot that suggests function composition, 
*unless* ...

AntC







More information about the Haskell-Cafe mailing list