| ... | ... | @@ -23,25 +23,6 @@ put beginners off. |
|
|
|
|
|
|
|
Strictly speaking, the issue is not tied to the `do`-notation, but that is where it (almost?) always shows up.
|
|
|
|
|
|
|
|
|
|
|
|
Jon Fairbairn suggests that `case` should get the same treatment, for consistency:
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
do case whatever
|
|
|
|
of
|
|
|
|
blah -> bluh
|
|
|
|
blah' -> bluh'
|
|
|
|
```
|
|
|
|
|
|
|
|
>
|
|
|
|
> or perhaps
|
|
|
|
>
|
|
|
|
> ```wiki
|
|
|
|
> do case whatever of
|
|
|
|
> Cons -> bluh
|
|
|
|
> Nil -> foo
|
|
|
|
> ```
|
|
|
|
|
|
|
|
## Proposal
|
|
|
|
|
|
|
|
|
| ... | ... | @@ -56,10 +37,16 @@ This has been recently added to jhc, GHC and Hugs, and so far it has not caused |
|
|
|
|
|
|
|
|
|
|
|
The second optional semicolon is the important one.
|
|
|
|
The first one just adds a little more convenience;
|
|
|
|
it has been suggested that it would be consistent to do the same before `of` in `case` expressions.
|
|
|
|
The first one just adds a little more convenience.
|
|
|
|
|
|
|
|
**Possible addition**: Jon Fairbairn suggests that if an optional semicolon is added before `then`, it would be consistent to also add one before `of` in `case` expressions, allowing:
|
|
|
|
|
|
|
|
**Possible addition**: optional semicolon before/(after?) `of` in `case` expressions too.
|
|
|
|
```wiki
|
|
|
|
do case whatever
|
|
|
|
of
|
|
|
|
blah -> bluh
|
|
|
|
blah' -> bluh'
|
|
|
|
```
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
| ... | ... | |