Opened 4 years ago

Closed 3 years ago

#10162 closed feature request (fixed)

Add unicode syntax for banana brackets

Reported by: zardoz Owned by: JoshPrice247
Priority: low Milestone: 8.2.1
Component: Compiler (Parser) Version: 7.8.4
Keywords: unicode, UnicodeSyntax, newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D2012
Wiki Page:

Description

While there is a “pretty” unicode alternative available for “-<“ within arrow notation (⤙), banana brackets can only be written as “(|” and “|)”, which is a bit of an eyesore when they are used in the middle of the fancy arrow glyphs.

Maybe it would be convenient to add the following unicode alternatives, which to the best of my knowledge are mapped by default within the XCompose definitions shipped with XOrg.

⦆ right white parenthesis (U+2986) ⦅ left white parenthesis (U+2985)

Alternatively, these would also correspond well with the plain ASCII syntax:

⦇ z notation left image bracket (U+2987) ⦈ z notation right image bracket (U+2988)

Change History (9)

comment:1 Changed 3 years ago by zardoz

I’ve noticed that this has been proposed before, in passing, but wasn’t part of the respective patch.

https://ghc.haskell.org/trac/ghc/ticket/2978

Beside banana brackets, the ticket also proposed these, which seem to fit together nicely.

  • For TemplateHaskell: ⟦ ⟧ (MATHEMATICAL _ WHITE SQUARE BRACKET) can be used instead of [| |]
  • For Generics: ⦃ ⦄ (_ WHITE CURLY BRACKET) can be used instead of {| |}
  • For Arrows: ⦇ ⦈ (Z NOTATION _ IMAGE BRACKET) can be used instead of (| |)

comment:2 Changed 3 years ago by thomie

Please ask the glasgow-haskell-users mailinglist to see if other want this as well. See WorkingConventions/AddingFeatures. This is not going to get a lot of attention otherwise.

comment:3 Changed 3 years ago by thomie

Component: CompilerCompiler (Parser)
Keywords: unicode UnicodeSyntax added
Milestone:
Resolution: invalid
Status: newclosed

I'm closing some of these unicode related feature requests, as a discussion needs to happen first on one of the mailing lists. Please reopen this ticket once there is sufficient support.

comment:4 Changed 3 years ago by goldfire

Keywords: newcomer added
Resolution: invalid
Status: closednew

Though getting a groundswell of support for feature requests is indeed a good idea, this one here seems pretty obviously a good idea, to me. It's a great way for a newcomer to contribute!

comment:5 Changed 3 years ago by JoshPrice247

Owner: set to JoshPrice247

comment:6 Changed 3 years ago by JoshPrice247

Differential Rev(s): Phab:D2012

comment:7 Changed 3 years ago by Iceland_jack

Are there any plans of supporting idiom brackets? ⦇ Just 1 + Just 2 ⦈ could be used and Arrows are not used much at all

comment:8 Changed 3 years ago by Ben Gamari <ben@…>

In 03a1bb4d/ghc:

Add unicode syntax for banana brackets

Summary:
Add "⦇" and "⦈" as unicode alternatives for "(|" and "|)" respectively.

This must be implemented differently than other unicode additions
because ⦇" and "⦈" are interpretted as a $unigraphic rather than
a $unisymbol.

Test Plan: validate

Reviewers: goldfire, bgamari, austin

Reviewed By: bgamari, austin

Subscribers: thomie, mpickering

Differential Revision: https://phabricator.haskell.org/D2012

GHC Trac Issues: #10162

comment:9 Changed 3 years ago by bgamari

Milestone: 8.2.1
Resolution: fixed
Status: newclosed

Are there any plans of supporting idiom brackets? ⦇ Just 1 + Just 2 ⦈ could be used and Arrows are not used much at all

I don't know of any work along these lines.

Note: See TracTickets for help on using tickets.