[GHC] #8959: GHCi should honour UnicodeSyntax

#8959: GHCi should honour UnicodeSyntax -------------------------------------------+------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | 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: -------------------------------------------+------------------------------- When we load a module into GHCi with -XUnicodeSyntax, GHCi should default to printing information with the relevant unicode symbols. {{{ *Communication> let a ∷ Int; a = 7 *Communication> :t a a :: Int }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: 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: | -------------------------------+------------------------------------------- Comment (by hvr): What about compiler errors/warnings? Should those use `UnicodeSyntax` as well if enabled? What about `ghc`'s compile messages in general? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: nomeata Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: 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: | -------------------------------+------------------------------------------- Changes (by nomeata): * owner: => nomeata -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax
-------------------------------+-------------------------------------------
Reporter: Fuuzetsu | Owner: nomeata
Type: bug | Status: new
Priority: low | Milestone:
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
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: |
-------------------------------+-------------------------------------------
Comment (by Joachim Breitner

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: nomeata Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: 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: | -------------------------------+------------------------------------------- Comment (by nomeata): That was indeed straight-forward, pushed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: nomeata Type: bug | Status: closed Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: 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: | -------------------------------+------------------------------------------- Changes (by nomeata): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: nomeata Type: bug | Status: closed Priority: low | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: 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: | -------------------------------+------------------------------------------- Changes (by hvr): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: 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: | -------------------------------+------------------------------------------- Changes (by nomeata): * owner: nomeata => * status: closed => new * resolution: fixed => Comment: I just noticed that my patch only works if `-XUnicodeSyntax` is passed on the command line, or set with `:set`. It does not work simply because you load a file with `LANGUAGE UnicodeSyntax`. Should it? Other pragmas (tested it with `RankNTypes`) in a loaded file also don’t affect what you enter at GHCi. Also, the pragma does not have an effect on the error message printed by the compiler in error messages from a file with `UnicodeSyntax` active. The `dynflag` passed to the pretty-printer seems to be a different one than used when type-checking. (Reopening) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax
-------------------------------+-------------------------------------------
Reporter: Fuuzetsu | Owner:
Type: bug | Status: new
Priority: low | Milestone: 7.10.1
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
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: |
-------------------------------+-------------------------------------------
Comment (by Joachim Breitner

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: 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: | -------------------------------+------------------------------------------- Comment (by hvr): Replying to [comment:7 nomeata]:
Should it? Other pragmas (tested it with `RankNTypes`) in a loaded file also don’t affect what you enter at GHCi.
Btw, the prompt is usually affected by `:seti -X...` rather than `:set -X...` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: closed Priority: low | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: 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: | -------------------------------+------------------------------------------- Changes (by nomeata): * status: new => closed * resolution: => fixed Comment:
Btw, the prompt is usually affected by :seti -X... rather than :set -X...
Yes, just read up on that in the docs. But `:set` is not wrong either... So I guess there is a more general question there: If I load a module into GHCi with a `*` (i.e. the “inside view” with everything top-level in scope), then in a way I have “entered” that module. Shouldn’t then all language pragmas of that module hold for me as well? And as general as this question is, it has of course been discussed before. I found #5673 (which I even took part in – I need to buy better memory ;-)) which points to [wiki:3217#comment:15] So #3217 covers the remaining bits of this ticket well, closing this (again). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: closed Priority: low | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: 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: | -------------------------------+------------------------------------------- Comment (by nomeata): Sigh: #3217 is not all there is to fix. Independent of GHCi we seem to want error messages from modules with `UnicodeSyntax` printed with that syntax. So we need to instrument `SDoc` in error messages with the settings from where the setting originated. The `dynflags` passed in `SDocContext` does not work for this, as they are the dynflags in scope when the error is printed, i.e. outside the module scope. There is precedence: The `PrintUnqualified` field of `ErrMsg` and later of `PprUser` transports information about how to pretty print stuff from the location of error to when its `SDoc` is rendered. I added a `Bool` there to indicate whether `UnicodeSyntax` should be used and it seems to work, but I’m not satisfied with this design. Stored the change in the `wip/T8959` branch, see [changeset:4a4e684f4/ghc]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------+------------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: 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: | -------------------------------+------------------------------------------- Changes (by nomeata): * status: closed => new * resolution: fixed => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by int-e): I'm unhappy with this change, because it uses a language extension that affects accepted **input** (namely, `UnicodeSyntax`) to modify the **output** of ghci. I would prefer having a ghci-specific option (say, `:set +/-u` or more verbosely, `:set +/-unicodeoutput`) instead. This is not just cosmetics; the current behaviour broke lambdabot's `:t` and `:k` commands, which parse ghci's output. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by shachaf): I have the same problem with this change as int-e -- the extension previously affected only input and now silently started to affect output too. I've turned it off in my `.ghci` as a result. I also think that a separate output flag is the right approach -- compare `-XExplicitForAll` vs. `-fprint-explicit-foralls`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata): The reference to `-XExplicitForAll` vs. `-fprint-explicit-foralls` is a good point.. But it’s already released, so any tools that are broken will likely get a fix anyways. I’m unsure on how to proceed here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by int-e): I'm sorry I didn't find this while testing the release candidates. I did not expect such "simple" ghci queries to break, and besides lambdabot does not enable `UnicodeSyntax` by default, that's a customization for the one running on Freenode. My current "fix" for lambdabot to disable `UnicodeSyntax` for the two affected commands. This is the only sensible option because I do not want lambdabot to use the unicode symbols in its type signatures; in other words, fixing lambdabot properly (such that unicode syntax is allowed in the input) is not possible at this time. How would you feel about keeping the current behaviour by default, but adding flags `-fprint-unicode-syntax` and `-fno-print-unicode-syntax` to override the default, regardless of whether `UnicodeSyntax` is enabled or not? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by int-e): I've implemented the simple semantics where `-fprint-unicode-syntax` determines whether printing types and kind uses unicode syntax or not. The three-state behaviour from comment 17 would require more work. In any case I'm now using this implementation with lambdabot. (The patch is against ghc's HEAD; a patch for ghc-7.10.1 can be found in lambdabot's repository: https://github.com/lambdabot/lambdabot/blob/freenode/patches/ghc-7.10.1.patc...) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Changes (by int-e): * differential: => Phab:D807 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Comment (by int-e): Replying to [comment:18 int-e]:
The three-state behaviour from comment 17 would require more work.
Perhaps more importantly, it would be more difficult to explain to users. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner:
Type: bug | Status: new
Priority: low | Milestone: 7.12.1
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D807
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Comment (by int-e): Is there a chance of getting the -fprint-unicode-syntax flag into 7.10.2? Personally I think the chances of breaking anything are slim, but it's not an easy call to make. (I still regret that I didn't find this in the RCs) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner:
Type: bug | Status: new
Priority: low | Milestone: 7.12.1
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D807
-------------------------------------+-------------------------------------
Comment (by thomie):
Here's another commit in the #8959 series:
6e4a75001fae1bf9251907d605b3f0b74da537cb
{{{
Author: Joachim Breitner

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: merge Priority: low | Milestone: 7.10.2 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => merge * milestone: 7.12.1 => 7.10.2 Comment: I think work is done here. int-e is asking for a merge to 7.10.2 of 6dd2765a300bb139b4ab67688dbc6f48de66969b -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: merge Priority: low | Milestone: 7.10.2 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Comment (by thoughtpolice): Hmmmm, I'm rather inclined to leave this one out I'm afraid. Does anyone have any opinions? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: merge Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * milestone: 7.10.2 => 7.12.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:26 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: closed Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D807 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: After discussing it, I think we're going to punt this and just leave it to 7.12.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8959#comment:27 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8959: GHCi should honour UnicodeSyntax
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner: (none)
Type: bug | Status: closed
Priority: low | Milestone: 8.0.1
Component: Compiler | Version: 7.6.3
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D807
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski
participants (1)
-
GHC