[GHC] #16299: :info pretty-prints data types with non-Type return kinds oddly
#16299: :info pretty-prints data types with non-Type return kinds oddly -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 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: -------------------------------------+------------------------------------- Consider this GHCi session: {{{ $ ghci -XUnboxedTuples GHCi, version 8.6.3: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/ryanglscott/.ghci λ> :i (##) data (##) :: TYPE ('GHC.Types.TupleRep '[]) = (##) -- Defined in ‘GHC.Prim’ }}} Notice that we're printing `data (##) :: TYPE ('GHC.Types.TupleRep '[]) = (##)`. Yuck! Granted, you can't define an unboxed tuple like this anyway, but the presence of that kind signature (which definitely doesn't belong in a Haskell98-style data declaration) makes things worse. In case if you're wondering if this is an unboxed tuple–specific problem, it's not. This issue also creeps up in the [https://phabricator.haskell.org/D4777 WIP implementation] of unlifted newtypes: {{{ λ> newtype T = MkT Int# λ> :i T newtype T :: TYPE 'IntRep = MkT Int# -- Defined at <interactive>:5:1 }}} However, as this ticket demonstrates, this problem has existed well before the unlifted newtypes patch, and more importantly, this can be fixed independently of that patch. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16299> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16299: :info pretty-prints data types with non-Type return kinds oddly -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 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: | https://gitlab.haskell.org/ghc/ghc/merge_requests/343 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => https://gitlab.haskell.org/ghc/ghc/merge_requests/343 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16299#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16299: :info pretty-prints data types with non-Type return kinds oddly -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.10.1 Component: Compiler | Version: 8.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | ghci/scripts/T7627 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/343 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => ghci/scripts/T7627 * resolution: => fixed * milestone: => 8.10.1 Comment: Landed in [https://gitlab.haskell.org/ghc/ghc/commit/8b476d822e97cfe4cebe6e74924d9a7914... 8b476d822e97cfe4cebe6e74924d9a79148d608c]. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16299#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16299: :info pretty-prints data types with non-Type return kinds oddly -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.10.1 Component: Compiler | Version: 8.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | ghci/scripts/T7627 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/343 -------------------------------------+------------------------------------- Comment (by Marge Bot <ben+marge-bot@…>): In [changeset:"8b476d822e97cfe4cebe6e74924d9a79148d608c/ghc" 8b476d82/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="8b476d822e97cfe4cebe6e74924d9a79148d608c" Fix #16299 by deleting incorrect code from IfaceSyn GHCi's `:info` command was pretty-printing Haskell98-style data types with explicit return kinds if the return kind wasn't `Type`. This leads to bizarre output like this: ``` λ> :i (##) data (##) :: TYPE ('GHC.Types.TupleRep '[]) = (##) -- Defined in ‘GHC.Prim’ ``` Or, with unlifted newtypes: ``` λ> newtype T = MkT Int# λ> :i T newtype T :: TYPE 'IntRep = MkT Int# -- Defined at <interactive>:5:1 ``` The solution is simple: just delete one part from `IfaceSyn` where GHC mistakenly pretty-prints the return kinds for non-GADTs. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16299#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC