[ghc-steering-committee] Proposal #302: Multiway lambda: time to vote

Eric Seidel eric at seidel.io
Fri Jul 23 11:04:03 UTC 2021



On Thu, Jul 22, 2021, at 12:54, Simon Peyton Jones wrote:
> Thanks Eric
> 
> |  adding syntax for multi-arg case is concerns around back compat. If we could
> |  go back in time and revise the original \case syntax to support multiple
> |  arguments, would we still end up with a single-arg construct and a multi-arg
> |  construct? I think probably not.
> 
> Actually I don't agree. I think we might well have \case (for 1) and 
> \cases (for 0-n) because
> * the cognitive overhead is vanishingly small (especially given the
>   singular/plural form
> * the absence of parens in the very common case of \case is extremely
>   convenient
> 
> I actively like the signal that \cases gives me, up front, "here comes 
> an nary lambda", rather than the very quiet commas of (2).  Whereas I 
> know that \case is always unary.

We don't have separate unary / n-ary constructs for function definitions or
lambdas. Do you think we should make the distinction there too? I don't
understand what makes \case so different.

The paren issue is valid, but in my opinion option (2) solves it better with
the comma separators.


More information about the ghc-steering-committee mailing list