[GHC] #13420: Bizarre pretty-printing of closed type families in GHCi

GHC ghc-devs at haskell.org
Tue Mar 14 00:35:16 UTC 2017


#13420: Bizarre pretty-printing of closed type families in GHCi
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  GHCi           |           Version:  8.0.2
           Keywords:  TypeFamilies   |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Load this code:

 {{{#!hs
 {-# LANGUAGE TypeFamilies #-}
 module Bug where

 type family F a where
   F [Int] = Bool
   F [a]   = Double
   F (a b) = Char
 }}}

 into GHCi 8.0.1, 8.0.2, or HEAD, and run `:i F`. You'll see this:

 {{{
 $ /opt/ghc/8.0.2/bin/ghci Bug.hs
 GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 Ok, modules loaded: Bug.
 λ> :i F
 type family F a :: *
   where
       F [Int] = Bool
     [a] F [a] = Double
     [b, (a :: * -> *)] F (a b) = Char
         -- Defined at Bug.hs:4:1
 }}}

 Compare this with GHCi 7.10.3, where the pretty-printing is far more sane:

 {{{
 $ /opt/ghc/7.10.3/bin/ghci Bug.hs
 GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )
 Ok, modules loaded: Bug.
 λ> :i F
 type family F a :: * where
     F [Int] = Bool
     F [a] = Double
     F (a b) = Char
         -- Defined at Bug.hs:4:1
 }}}

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


More information about the ghc-tickets mailing list