Unicode alternative for '..' (ticket #3894)

Roel van Dijk vandijk.roel at gmail.com
Wed Apr 14 05:18:09 EDT 2010


I'm a big fan of the UnicodeSyntax [1] language extension. But I don't
particularly like the alternative for the ellipsis '..'. I'm not sure
if it was a conscious choice or a mistake to use the '⋯' character. I
haven't really encountered that symbol before except for matrices and
the like [2]. Therefore I propose to change the character from '⋯' to
'…'. I submitted a bug report for this a few weeks ago [3]. Today I
attached a patch which implements this change.

Here are 4 code snippets for comparison:

-- Simple ASCII
import Data.Bool ( Bool(..) )
f :: [Int]
f = [1, 3 .. 10] ++ [10..100]

-- Current situation (MIDLINE HORIZONTAL ELLIPSIS, U+22EF)
import Data.Bool ( Bool(⋯) )
f ∷ [Int]
f = [1, 3 ⋯ 10] ++ [10⋯100]

-- Proposed change (HORIZONTAL ELLIPSIS, U+2026)
import Data.Bool ( Bool(…) )
f ∷ [Int]
f = [1, 3 … 10] ++ [10…100]

-- Another alternative (TWO DOT LEADER, U+2025)
import Data.Bool ( Bool(‥) )
f ∷ [Int]
f = [1, 3 ‥ 10] ++ [10‥100]

The TWO DOT LEADER also looks nice, but I think we must consider more
than looks alone (which is a matter of fonts) and take the semantics
into account.

I would really like some feedback on this since it is a change that
breaks backwards compatibility (even though it is a really small
change).

Regards,
Roel van Dijk

1 - http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#unicode-syntax
2 - http://en.wikipedia.org/wiki/Ellipsis#In_mathematical_notation
3 - http://hackage.haskell.org/trac/ghc/ticket/3894


More information about the Glasgow-haskell-users mailing list