[Haskell-cafe] extra semi-colons
Johannes Waldmann
johannes.waldmann at htwk-leipzig.de
Tue Jun 25 10:43:03 UTC 2019
Dear Cafe,
why does ghc accept the extra semi-colon in
case () of { () -> (); }
or even
case () of { ;;; () -> () ;;; }
Yes I understand that semicolons like this
are introduce by the layout rule
L (<n> : ts) (m : ms) = ; : (L ts (m : ms)) if m = n
https://www.haskell.org/onlinereport/haskell2010/haskellch10.html#x17-17800010.3
and it's convenient to ignore extra ones.
But it's not in the grammar?
alts → alt1 ; … ; altn (n ≥ 1)
https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.13
- J.
More information about the Haskell-Cafe
mailing list