In ghci you can run the :info command to learn about the methods defined on a type class, as well as see instances of that type class.
For example, :info Eq outputs
class Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
-- Defined in `GHC.Classes'
as well as many lines of the instances
instance (Eq k, Eq a) => Eq (Map k a)
-- Defined in `containers-0.5.0.0:Data.Map.Base'
instance Eq a => Eq (Maybe a) -- Defined in `Data.Maybe'
...
Is there a way, in ghci, to just output the methods defined in the type class without also outputting all the instances? In other words, I would like a ghci command to output only this:
class Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
-- Defined in `GHC.Classes'
:info. There are often many instances, and sometimes it's hard to find the class information among all the outputs. I'll mark a "no" answer as correct, if you want to submit an answer. - apolune