[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SYNTAX ONLY: Lambda
From: fplangc-request@cs.ucl.ac.uk
Date: 29 May 91 16:43
Sender: Simon L Peyton Jones <simonpj@cs.glasgow.ac.uk>
To: fplangc@cs.ucl.ac.uk
Cc: Maria Mercedes Gutierrez de Guzman <guzman-maria@cs.yale.edu>,
Paul Hudak <hudak%cs.yale.edu@nsfnet-relay.ac.uk>
Subject: SYNTAX ONLY: Lambda
X-Comment1: #############################################################
X-Comment2: # uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs #
X-Comment3: # If this address does not work please ask your mail #
X-Comment4: # administrator to update your NRS & mailer tables. #
X-Comment5: #############################################################
Will and I have a proposal to simplify Haskell:
Do not allow guards on a lambda abstraction
The current report allows a sequence of patterns followed by an optional
*single* guard. This seems really bizarre:
if the guard fails, the program fails (because you can't use
the guard to fall through to another equation, because in lambda
there can only be one guard)
so one could equally well use a conditional to do the same thing
Having a guard there also encourages the programmer to believe that
s/he could use WHERE too.
This is all nuts. Nuke the guard. Lambdas should be really simple.
If you want something more complex, lambda followed by case.
(Alternative: allow full multiple patterns, multiple guards and
where for lambda, as for case. We discussed and discarded this option
years ago, on stylistic grounds.)
Simon