Hello Simon, there was no discussion because I thought that this would be completely uncontroversial since: (i) it does not change the current behavior, and (ii) it adds new functionality which is quite useful. Here is the use case that motivated me to implement this (described by Eric Mertens, cc-ed on this e-mail). The example uses the `lens` package.
I know that Accessor has an Applicative instace because the operations work. I'd like to find the instance, so I can see how it works, so I try: Prelude Control.Applicative Control.Lens> :i Accessor newtype Accessor r a = Control.Lens.Internal.Accessor {Control.Lens.Internal.runAccessor :: r} -- Defined in `Control.Lens.Internal' instance Functor (Accessor r) -- Defined in `Control.Lens.Internal' instance Gettable (Accessor r) -- Defined in `Control.Lens.Internal’ Weird, it doesn’t show up, so what are the instances of `Applicative`? Prelude Control.Applicative Control.Lens> :i Applicative class Functor f => Applicative f where pure :: a -> f a (<*>) :: f (a -> b) -> f a -> f b (*>) :: f a -> f b -> f b (<*) :: f a -> f b -> f a -- Defined in `Control.Applicative' instance Applicative [] -- Defined in `Control.Applicative' instance Applicative ZipList -- Defined in `Control.Applicative' instance Monad m => Applicative (WrappedMonad m) -- Defined in `Control.Applicative' instance Applicative Maybe -- Defined in `Control.Applicative' instance Applicative IO -- Defined in `Control.Applicative' instance Applicative (Either e) -- Defined in `Control.Applicative' instance Applicative ((->) a) -- Defined in `Control.Applicative' instance Applicative Mutator -- Defined in `Control.Lens.Internal' instance Applicative (Bazaar a b) -- Defined in `Control.Lens.Internal’ It does not show up, but I'm sure that there is an instance as the operations seem to work! It turns out that the only way to find the instance is to not only already know that there is one and import the appropriate module, but to also import the modules used in the context. But if I already knew all of this I wouldn't have asked GHCi. Prelude Control.Applicative Control.Lens> import Data.Monoid Prelude Control.Applicative Control.Lens Data.Monoid> :i Accessor newtype Accessor r a = Control.Lens.Internal.Accessor {Control.Lens.Internal.runAccessor :: r} -- Defined in `Control.Lens.Internal' instance Functor (Accessor r) -- Defined in `Control.Lens.Internal' *instance Monoid r => Applicative (Accessor r)* -- Defined in `Control.Lens.Internal' instance Gettable (Accessor r) -- Defined in `Control.Lens.Internal' In contrast, with ":info!" we get everything that GHCi knows about, so it is quite easy to figure out what's going on. -Iavor On Fri, Nov 30, 2012 at 3:42 AM, Simon Marlow <marlo...@gmail.com> wrote: > On 30/11/12 02:03, Iavor Diatchki wrote: > >> Repository : >> ssh://darcs.haskell.org//srv/**darcs/ghc<http://darcs.haskell.org//srv/darcs/ghc> >> >> On branch : master >> >> http://hackage.haskell.org/**trac/ghc/changeset/** >> 2ec32a8e1cb323b230b0c228dbee31**3647892bf4<http://hackage.haskell.org/trac/ghc/changeset/2ec32a8e1cb323b230b0c228dbee313647892bf4> >> >> ------------------------------**------------------------------**--- >>> >> >> commit 2ec32a8e1cb323b230b0c228dbee31**3647892bf4 >> Author: Iavor S. Diatchki <diatc...@galois.com> >> Date: Thu Nov 29 17:14:48 2012 -0800 >> >> Add ":info!" to GHCi. This shows all instances without filtering >> first. >> >> The default behavior of :info is to show only those instances of >> for a type, where all relevant type constructor names are in scope. >> This keeps down the number of instances shown to the user. >> >> In some cases, it is nice to be able to see all instances for a type. >> This patch implements this with the :info! command. >> > > Was there some discussion about this? The last I remember was this: > > http://hackage.haskell.org/**trac/ghc/ticket/5998<http://hackage.haskell.org/trac/ghc/ticket/5998> > > where we decided not to implement this because it is essentially a random > UI: the behaviour can't be described sensibly because it depends on which > interface files GHC happens to have seen so far. > > There's also this: > > http://hackage.haskell.org/**trac/ghc/ticket/3080<http://hackage.haskell.org/trac/ghc/ticket/3080> > > which looks like a duplicate (I just closed it). > > Cheers, > Simon > > > > > ______________________________**_________________ > Cvs-ghc mailing list > Cvs-ghc@haskell.org > http://www.haskell.org/**mailman/listinfo/cvs-ghc<http://www.haskell.org/mailman/listinfo/cvs-ghc> >
_______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc