Implict parameters and monomorphism

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
3 May 2001 15:04:17 GMT


Wed, 2 May 2001 10:51:58 +0200 (MET DST), John Hughes <rjmh@cs.chalmers.se> pisze:

> Breaking the monomorphism restriction in ANY case makes both space
> and time cost of evaluation unpredictable, and brittle when program
> changes elsewhere introduce or remove an implicit parameter.

You can always use 'case' instead of 'let' for variable bindings.

I would remove the monomorphism restriction, leaving 'let' mostly for
function-like bindings, which can be optimized to value bindings in
some cases.

Perhaps it would be good to introduce strictness annotations in 'let'
and 'where'. Clean has 'let!'. It would allow increasing strictness
yet more than 'case' does, without the need of transforming 'let'
into 'case' or adding `seq`.

I would attach '!' to individual variables (or patterns) rather than
to 'let', so it's usable in 'where', 'case' and function arguments,
with some bindings strict and others lazy. The semantics would insert
    var `seq`
at the start of the appropriate body or rhs for each strict-marked
var, in unspecified order (it doesn't matter in what order they are
evaluated, it matters that all are evaluated).

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK