The dreaded M-R
rjmh at cs.chalmers.se
Mon Jan 30 09:30:29 EST 2006
From: Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl>
John Hughes <rjmh at cs.chalmers.se> writes:
>> By the way, you leave out a lot of type signatures too. Your Djinn
>> module contains 29 declarations with type signatures--and 17
>> without. The 17 are local, but local declarations are precisely
>> those where, without the M-R, a lack of sharing would be most likely
>> to bite.
Local definitions are rarely used polymorphically.
Perhaps without a type signature the definition should be polymorphic
and recomputed if it's global, and monomorphic and shared if it's local.
Probably this is normally what you want--but oh, how confusing it would be!
I'd like to be able to give a simple answer to the question "Is this
or not?", not an answer that begins with "Is there a type signature?", "What
does the type signature look like?", and "Is it local or global?"!
This would open for very confusing behaviour when refactoring code, to move
bindings between top-level and a local scope.
More information about the Haskell-prime