1 Unicode Ellipsis¶
1.1 Motivation¶
We already have beautiful Unicode make-up for all reserved symbols. And they look great!
But no, not for all. The poor ellipsis ..
is left without. It wants
to look like this: …
.
1.2 Proposed Change Specification¶
When the UnicodeSyntax
extension is enabled:
Make
…
accepted wherever..
is accepted.Allow
…
in situations like[False…]
where ASCII syntax[False..]
would be a parse error. (This is automatically the case with the patch proposed below.) (Thanks to Jakob Brünker forpointing this out.)
1.3 Examples¶
{-# language UnicodeSyntax #-}
{-# language RecordWildCards #-}
module X where
import Prelude (Bool (…))
data Record = Record {value ∷ Bool}
function ∷ Record → Bool
function Record {…} = value
booleans ∷ [Bool]
booleans = [False…]
1.4 Effect and Interactions¶
Ellipsis gets its beautiful Unicode make-up.
1.5 Costs and Drawbacks¶
There are no costs and no drawbacks.
1.6 Alternatives¶
There are no alternatives.
1.7 Unresolved Questions¶
There are no unresolved questions.
1.8 Implementation Plan¶
Apply this patch:
diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x
index d74d17be8f..4135372d31 100644
--- a/compiler/GHC/Parser/Lexer.x
+++ b/compiler/GHC/Parser/Lexer.x
@@ -1063,6 +1063,7 @@ reservedSymsFM = listToUFM $
,("-<<", ITLarrowtail NormalSyntax, NormalSyntax, xbit ArrowsBit)
,(">>-", ITRarrowtail NormalSyntax, NormalSyntax, xbit ArrowsBit)
+ , ("…", ITdotdot, UnicodeSyntax, 0 )
,("∷", ITdcolon UnicodeSyntax, UnicodeSyntax, 0 )
,("⇒", ITdarrow UnicodeSyntax, UnicodeSyntax, 0 )
,("∀", ITforall UnicodeSyntax, UnicodeSyntax, 0 )
1.9 Endorsements¶
There are no endorsements.