I have just been trying to use a local definition in a list comprehen-
sion, and found, of course, that it could not be done. Thus, when list
comprehensions are being used to define complex structures, whole
expressions often have to be repeated, which is primitive, to say the
least. (Either that, or fudge it by drawing the local variable from a
singleton list.)
I'm fairly sure that local definitions were possible in Miranda(TM), and
I see they are permitted in Gofer. Mark Jones explains why they are not
part of Haskell, on page 44 of the Gofer manual:
Local definitions: A qualifier of the form pat = expr [...]
[ e | pat = exp ] = [ let pat=exp in e ]
[...] There was a certain amount of controversy surrounding the
choice of an appropriate syntax and semantics for the construct
and consequently, this feature is not currently part of the
Haskell standard.
I'm sorry if, by being new to this list, I have missed discussion about
this issue, but could somebody briefly explain the `controversy'? And
has it now been resolved, i.e., will local definitions in list compre-
hensions be defined in Haskell 1.3?
+-------------------------------------+--------------------------------+
| howard s goodman (research student) | school of computer science |
| [EMAIL PROTECTED] | university of birmingham |
| | birmingham - england - B15 2TT |
+-------------------------------------+--------------------------------+