[GHC] #12005: Constraint instances not shown in `:info`

GHC ghc-devs at haskell.org
Tue Sep 25 23:16:30 UTC 2018


#12005: Constraint instances not shown in `:info`
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.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:                    |
-------------------------------------+-------------------------------------

Comment (by harpocrates):

 You may be interested in `:info!` which returns a more reliably complete
 listing of instances.

 {{{
 Prelude Data.Kind> :i Defer
 class Defer (p :: Constraint) where
   defer :: (p => r) -> r
   {-# MINIMAL defer #-}
         -- Defined at <interactive>:2:1
 instance [safe] Defer (() :: Constraint)
   -- Defined at <interactive>:3:10
 }}}

 The reason `instance Defer (() :: Constraint)` is filtered out from the
 output of `:info` is due to  `GHC.getInfo`. Unless instructed to not
 filter its output, this last function will check that //all// names in an
 instance head are in scope before reporting it. Due to some wrinkles
 around constraint tuples, `() :: Constraint` doesn't satisfy this check. I
 consider this a bug.

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


More information about the ghc-tickets mailing list