[GHC] #9119: Additional symbols for XUnicodeSyntax

#9119: Additional symbols for XUnicodeSyntax -------------------------------------------+------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Parser) | Version: 7.8.2 Keywords: unicode | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- So, one of the things I love about Haskell is how relatively mathematically friendly it is. To that end, I propose the following additional unicode operators be added to XUnicodeSyntax: "⊦ p → x" for "let p in x" "≝" "≜" "≛" "≚" "≙" "≟" "⇔" "≐" "≞" be added as synonyms for "=" -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by spacekitteh): I am building+testing these patches now, will report back, but they should work :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by spacekitteh): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by spacekitteh): Oh, I did not realised that the tokens were context insensitive. I will have to find another symbol for "in." -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by spacekitteh): Ok, patch is validated. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by nomeata): I have strong doubts about the usefulness of the extra equality symbols. By making the parser detect them as `=` you take away the possibility for the user to define them as functions in their code. `≟` might be quite useful in, say, test suites. Also, without knowing much about parsing, doesn’t {{{ ,("→", ITrarrow, unicodeSyntaxEnabled) ,("→", ITin, unicodeSyntaxEnabled) }}} conflict? Or will the parser do the right thing here? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by carter): I'm inclined to agree with @nomeata. Nothing precludes you from having a "unicode symbols module" you import for your own codes, so that fails the "Fairbarn Threshold" heuristic http://www.haskell.org/pipermail/libraries/2012-February/017548.html This let syntax idea is interesting though! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by spacekitteh): No, the parser didn't like it, @nomeata, that's why I changed it to {{{ ,("⊦", ITin, unicodeSyntaxEnabled) ,("∃", ITlet, unicodeSyntaxEnabled) }}} As for the extra equality symbols, I only ended up implementing three which make more sense as synonyms for assignment rather than equality testing: {{{ -- "Is estimated by" ,("≙", ITequal, unicodeSyntaxEnabled) -- "Is definitally equal to" ,("≝", ITequal, unicodeSyntaxEnabled) -- "Is measured by" ,("≞", ITequal, unicodeSyntaxEnabled) }}} The first one would be useful for situations such as numerical integration: {{{ area ≙ rk4 f' }}} The second one would be useful with combinators: {{{ sum ≝ foldr1 (+) }}} The third one is useful for hardware IO: {{{ accel ::() -> IO Double accel ≞ readAccelerometer() -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by spacekitteh): Also, trac is weird so I couldn't figure out how to delete the first two patches. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by spacekitteh): * milestone: => 7.8.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: | Architecture: Unknown/Multiple Operating System: Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: None/Unknown | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by carter): * milestone: 7.8.3 => Comment: 7.8 series is only for bug fixes now. Removing the milestone for now :) And there hasn't really been any real discussion of the proposed syntactic extensions. That really needs to happen for them to be considered for merging. :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: | Owner: spacekitteh | Status: infoneeded Type: feature | Milestone: request | Version: 7.8.2 Priority: normal | Keywords: unicode Component: Compiler | Architecture: Unknown/Multiple (Parser) | Difficulty: Easy (less than 1 Resolution: | hour) Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => infoneeded Comment: Yes, this is really going to need a somewhat wider discussion first, I think. @spacekitteh would you be willing to email `ghc-devs`, asking about this bug? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9119: Additional symbols for XUnicodeSyntax -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: closed Priority: normal | Milestone: ⊥ Component: Compiler | Version: 7.8.2 (Parser) | Keywords: unicode Resolution: invalid | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: infoneeded => closed * resolution: => invalid * milestone: => ⊥ Comment: See also: WorkingConventions/AddingFeatures. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9119#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC