:info features

Simon Marlow marlowsd at gmail.com
Thu Feb 12 03:47:36 EST 2009


Remi Turk wrote:
> On Tue, Feb 10, 2009 at 01:31:24PM +0000, Simon Marlow wrote:
>> Remi Turk wrote:
>>> On Sat, Feb 07, 2009 at 12:39:03AM -0500, Brandon S. Allbery KF8NH wrote:
>>>> On 2009 Feb 5, at 5:49, Remi Turk wrote:
>>>>> SPJ agreed with the idea itself, but suggested an alternative set 
>>>>> of  commands:
>>>>>
>>>>>   :info Show        -- See class definition only
>>>>>   :instances Show   -- See instances of Show
>>>> (...)
>>>>> However, it would make ":i" ambiguous, which is rather sad.
>>>> :class Show -- unique prefix :cl, already many such collisions
>>>> :instance Show
>>> That could work, but then how to get information about types as
>>> opposed to classes? Its not in the above example, but "Show"
>>> actually stands for an arbitrary typeclass _or type_.
>>>
>>> However, as igloo pointed out on the ticket, abbreviations don't
>>> actually have to be unique:
>>>
>>>  "For example, :b means :break even though we also have :back, :browse and :browse!. " [1]
>>>
>>> That would personally lead me to prefer the :info/:instances
>>> combo, with :i as an abbreviation of :info.
>> My vote would be:
>>
>> :info class Show
>> :info type Show
>> :info instance Show
>>
>> where
>>
>> :info Show
>>
>> displays information about everything called "Show"
>>
>> I know that classes and types share the same namespace currently, but it  
>> might not always be so.
> 
> Sounds good in principle, and has the advantage of being 100%
> backward compatible, but ":i class Show" for the common case
> (ahum, _my_ common case at least ;) still seems rather verbose,
> so how to abbreviate that?

How about a macro?

:def ic return . (":info class " ++)

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list