Polymorphism in the Prelude

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Wed Jun 25 13:51:46 UTC 2014


On 06/25/2014 01:10 AM, Edward Kmett wrote:
> 
> 
>> On Jun 24, 2014, at 3:08 PM, Daniel Gorín <dgorin at dc.uba.ar> wrote:
>>
>>
>>> On Tue, Jun 24, 2014 at 3:42 AM, Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> wrote:
>>> Do you have anything specific in mind here? At first I was just going to
>>> dismiss this as wishful thinking but perhaps we could actually do
>>> something about this.
>>>
>>> Maybe we could provide ‘alternative’ signatures which would make types
>>> more specific with some (which? all of known ones?) instances.
>>
>> One thing that might help is to list the specific type of methods below instance declarations, in a collapsible view to avoid cluttering. An example rendering (in "expanded view")  would be:
>>
>>> [-] instance Functor ((->) r) where
>>>     fmap :: (a -> b) -> (r -> a) -> (r -> b)
>>
>>
> 
> Being able to "open" an instance line in haddock to see what it means could be quite useful. It'd likely require a fair bit of work in haddock though as it'd have to synthesize that information somehow.
> 

I think that it might not be very hard to get this information from GHC
for regular typeclasses although it might be harder for TFs &c. I think
presentation is a big problem here and the rest is just figuring out how
to use the GHC API to spit out what we need.

-- 
Mateusz K.


More information about the Libraries mailing list