[GHC] #13700: GHCi command listing possible type class instances

GHC ghc-devs at haskell.org
Mon May 15 08:38:11 UTC 2017


#13700: GHCi command listing possible type class instances
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.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:
-------------------------------------+-------------------------------------
 This is a reminder ticket,

 I want to be able to list possible instances,

 {{{
 >>> :insts Product
 (Functor     f, Functor     g) => Functor     (Product f g)
 (Applicative f, Applicative g) => Applicative (Product f g)
 ...

 >>> :insts Product Identity
 Functor     g => Functor     (Product Identity g)
 Applicative g => Applicative (Product Identity g)
 Monad       g => Monad       (Product Identity g)
 MonadFix    g => MonadFix    (Product Identity g)
 MonadZip    g => MonadZip    (Product Identity g)
 ...

 >>> :insts Product Identity Identity
 Functor     (Product Identity Identity)
 Applicative (Product Identity Identity)
 Monad       (Product Identity Identity)
 MonadFix    (Product Identity Identity)
 MonadZip    (Product Identity Identity)
 }}}

 Would be so useful for `GeneralizedNewtypeDeriving`

 {{{#!hs
 newtype Pair a = P (Product Identity Identity a)
   deriving (Functor, Applicative, Monad, MonadFix, MonadZip, ...)

 -- pattern (:#) :: a -> a -> Pair a
 -- pattern a1 :# a2 = P (Identity a1 `Pair` Identity a2)
 }}}

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


More information about the ghc-tickets mailing list