[GHC] #14343: bad pretty-printing of types with promoted data types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[GHC] #14343: bad pretty-printing of types with promoted data types

GHC - devs mailing list
#14343: bad pretty-printing of types with promoted data types
-------------------------------------+-------------------------------------
           Reporter:  lspitzner      |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{
 > :set -XDataKinds
 > :set -XPolyKinds
 > data Proxy k = Proxy
 > _ :: Proxy '[ 'True ]
 error:
   Found hole: _ :: Proxy '['True]
 >             _ :: Proxy '['True]
 error:
     Invalid type signature: _ :: ...
     Should be of form <variable> :: <type>
 }}}

 Alternatively, this could be attributed to the parser/lexer doing an
 insufficient job there.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14343>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #14343: bad pretty-printing of types with promoted data types

GHC - devs mailing list
#14343: bad pretty-printing of types with promoted data types
-------------------------------------+-------------------------------------
        Reporter:  lspitzner         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Are you sure you put that in right?  With GHC 8.2.1 I get
 {{{
 Prelude> _ :: Proxy '[ 'True ]

 <interactive>:3:1: error:
     • Found hole: _ :: Proxy '['True]
     • In the expression: _ :: Proxy '[ 'True]
       In an equation for ‘it’: it = _ :: Proxy '[ 'True]
     • Relevant bindings include
         it :: Proxy '['True] (bound at <interactive>:3:1)
 }}}
 But if I miss out the space it parses `'['` as a character literal.
 {{{
 Prelude> _ :: Proxy '['True ]

 <interactive>:4:1: error:
     Invalid type signature: _ :: ...
     Should be of form <variable> :: <type>
 }}}
 Hard to avoid that.

 Make sense?  I'm inclined to say 'wont-fix'.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14343#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #14343: bad pretty-printing of types with promoted data types

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#14343: bad pretty-printing of types with promoted data types
-------------------------------------+-------------------------------------
        Reporter:  lspitzner         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by lspitzner):

 I am fine with '[' being lexed as it is, so i don't mind a wont-fix for
 that aspect. But why does the error message for syntactically valid input
 contain source fragments that are not syntactically valid?

 Just as a test for how input is transformed (on 8.2.1 as well):

 {{{
 Prelude> _ :: Proxy '[  'True ]                           -- 2 spaces in
 input

 <interactive>:8:1: error:
     • Found hole: _ :: Proxy '['True]                     -- 0 spaces
     • In the expression: _ :: Proxy '[ 'True]             -- 1 spaces
       In an equation for ‘it’: it = _ :: Proxy '[ 'True]  -- 1 spaces
     • Relevant bindings include
         it :: Proxy '['True] (bound at <interactive>:8:1) -- 0 spaces
 }}}

 The zeros are problematic, and i think the ones only avoid the problem
 because they don't really re-layout, they just merge whitespace (at least
 that's what i suspect; haven't looked at the source).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14343#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets