[Haskell-cafe] Type Directed Name Resolution

Richard O'Keefe ok at cs.otago.ac.nz
Wed Nov 10 20:19:18 EST 2010


On 10/11/2010, at 10:59 PM, John Smith wrote:
> Obvious benefits of this are that conflicting function names
> from imported modules can be used without qualification (verbose) 

Why is making life harder for people reading the code counted as
a "benefit"?

Let me offer an example from another language.

	aStream next	=> consume an item from an input stream
			   and return it
	aDate next	=> same as (aDate addDays: 1).

How do I cope in Smalltalk?  Simple: you don't put the type name in the
*function*, you put the type name in the *variable*.  If the code says

	frobnitz next

I haven't the least clue what it does or where to look to find out.

> it is often desirable to have the same field names
> for many records in the same module.

I'm not sure that it is desirable to have "many records in the
same module" in the first place.



More information about the Haskell-Cafe mailing list