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

GHC ghc-devs at haskell.org
Mon May 2 22:26:08 UTC 2016


#12005: Constraint instances not shown in `:info`
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.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:
-------------------------------------+-------------------------------------
 {{{
 $ ghci -ignore-dot-ghci -XKindSignatures -XRank2Types -XConstraintKinds
 -XAllowAmbiguousTypes -XInstanceSigs
 GHCi, version 8.1.20160428: http://www.haskell.org/ghc/  :? for help
 Prelude> import Data.Kind
 Prelude Data.Kind> class Defer (p :: Constraint) where defer :: (p => r)
 -> r
 Prelude Data.Kind> instance Defer () where defer :: r -> r; defer = id
 Prelude Data.Kind> :i Defer
 class Defer (p :: Constraint) where
   defer :: (p => r) -> r
   {-# MINIMAL defer #-}
         -- Defined at <interactive>:2:1
 }}}

 Same happens with the
 [https://github.com/ekmett/constraints/blob/master/src/Data/Constraint/Deferrable.hs
 Data.Constraint.Deferrable] which defines:

 {{{#!hs
 instance (Typeable a, Typeable b)                   => Deferrable (a ~ b)
 instance (Deferrable a, Deferrable b)               => Deferrable (a, b)
 instance (Deferrable a, Deferrable b, Deferrable c) => Deferrable (a, b,
 c)
 }}}

 but no instances are shown:

 {{{
 ghci> import Data.Constraint.Deferrable
 ghci> :i Deferrable
 class Deferrable (p :: Constraint) where
   deferEither :: proxy p -> (p => r) -> Either String r
   {-# MINIMAL deferEither #-}
         -- Defined in ‘Data.Constraint.Deferrable’
 }}}

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


More information about the ghc-tickets mailing list