[ghc-steering-committee] Proposal #302: `\of` (New Shepherd: Simon PJ)

Simon Peyton Jones simonpj at microsoft.com
Tue Jun 15 12:52:11 UTC 2021


|  I'd like to reassing shepherding of this one.

|

|  It seems to be clear that we want "something like this", there are many ways

|  to skin the cat, so it comes down to opinion and what we need is a decision

|  (or a call to votes). As with anything that's possibly quite opinionated,

|  it's good to have an authorative voice, so in this case, Simon PJ.

|

|  Simon, can you either come up with a "all things considered, I think this

|  variant is the (narrowly) the best" recommendation or, alternative, a

|  "please vote on the following options" verdict?



OK, to remind everyone

  *   Here is the proposal: https://github.com/JakobBruenker/ghc-proposals/blob/patch-1/proposals/0000-lambda-layout.md
  *   Here is the discussion: https://github.com/ghc-proposals/ghc-proposals/pull/302



The basic idea is to extend to lambda all the facilities that you get with function definitions, especially multiple patterns and guards.   This seems clearly a good idea, whose only obstacle is syntactic.  There are no conceptual or specification challenges.  The only point at issue is that of concrete syntax.



The proposal offers four possible syntactic options.  After reviewing, I propose to discard (2) and (3) leaving these alternatives



  *   Option (1)    \cases { p1 p2 -> rhs1; q1 q2 -> rhs2 }
     *   Lives alongside \case, but allows multiple patterns
     *   Other keywords are possible, but I think it must be a variant on \case
  *   Option (4)   Same, but use \case as the keyword
     *   Incompatible with existing \case => extended transition period, unhappy users
     *   \case { (Just x) -> rhs1; Nothing -> rhs2 } will require parens forever, which in the common case of a one argument lambda see clunky.
  *   Option (X).  Reject the proposal.

Personally I favour (1).   I'm relaxed about having multiple ways of saying the thing (think of let vs where), and I see no harm provided the two constructs look and behave the same.   I've decided I like \cases precisely because it's the plural of \case, which is exactly what is going on.
I think we'll end up having to vote on this, which is fine when it's a judgement call about syntax.   But first:

  *   Are there any other alternatives you strongly want on the ballot?
I say "strongly" because I don't want to open up a big new debate... we at the stage of trying to narrow options.
Thanks
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20210615/a5ef2064/attachment.html>


More information about the ghc-steering-committee mailing list