layout rule infelicity

Andrew J Bromage andrew@bromage.org
Fri, 31 May 2002 14:54:34 +1000


G'day all.

On Thu, May 30, 2002 at 01:10:03PM +0200, Johannes Waldmann wrote:

> Python has it as well (they stole it from Haskell?)

Python's layout rule looks more like Occam's than Haskell's, to my eyes.

Aside: Was Occam the first language of the post-punched-card era to use
layout as syntax?

> while we're at it - what's the deal with type inference?
> 
> sometimes I think it is *really bad* language design 
> if the program may contain untyped declarations of identifiers.

Presumably you're not suggesting requiring type declarations in
every pattern match too?

I think it's something to do with where you draw the line.  You could
theoretically require type declarations:

	- Nowhere, unless the type inference mechanism can't cope
	  with it.
	- Module interfaces.
	- Top-level declarations.
	- "where" clauses too.
	- "let"
	- Everywhere that a variable could be defined, including
	  case-expressions, list comprehension generators and
	  lambdas.
	- Every subexpression.

I personally think it's wrong not to require explicit type declarations
for everything exported from a module for engineering reasons.  Sane
separate compilation is important, IMO.

Cheers,
Andrew Bromage