instance visibility

Henning Thielemann lemming at henning-thielemann.de
Mon Sep 29 05:57:54 EDT 2008


On Fri, 26 Sep 2008, Duncan Coutts wrote:

> On Fri, 2008-09-26 at 21:51 +0100, Simon Marlow wrote:
>
>> There are basically only two sensible choices for the Functor instance
>> for (->):
>>
>>   (a) don't define one at all
>>   (b) define one in Control.Monad, and give up on Haskell 98 compliance
>>
>> The current situation, namely
>>
>>   (c) define it as an orphan, and give up on module abstraction
>>
>> is not a sensible choice.
>
> Right.
>
> No orphan instances in libraries.

Me too. Although I'm afraid some of my packages still contain orphan 
instances. When I need a new instance to an existing class+type I ask the 
library author for that instance and in the meantime I use a 'newtype'. 
Frequently a newtype turns out to be better anyway.


More information about the Libraries mailing list