Avoiding the hazards of orphan instances without dependency problems
David Feuer
david.feuer at gmail.com
Tue Oct 21 16:11:13 UTC 2014
As I said before, it still doesn't solve the problem I'm trying to solve.
Look at a package like criterion, for example. criterion depends on aeson.
Why? Because statistics depends on it. Why? Because statistics wants a
couple types it defines to be instances of classes defined in aeson. John
Lato's proposal would require the pragma to appear in the relevant aeson
module, and would prevent *anyone* else from defining instances of those
classes. With my proposal, statistics would be able to declare
{-# InstanceIn Statistics.AesonInstances AesonModule.AesonClass
StatisticsType #-}
Then it would split the Statistics.AesonInstances module off into a
statistics-aeson package and accomplish its objective without stepping on
anyone else. We'd get a lot more (mostly tiny) packages, but in exchange
the dependencies would get much thinner.
On Oct 21, 2014 11:52 AM, "Stephen Paul Weber" <singpolyma at singpolyma.net>
wrote:
> Somebody claiming to be John Lato wrote:
>
>> Thinking about this, I came to a slightly different scheme. What if we
>> instead add a pragma:
>>
>> {-# OrphanModule ClassName ModuleName #-}
>>
>
> I really like this. It solve all the real orphan instance cases I've had
> in my libraries.
>
> --
> Stephen Paul Weber, @singpolyma
> See <http://singpolyma.net> for how I prefer to be contacted
> edition right joseph
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20141021/34439861/attachment-0001.html>
More information about the ghc-devs
mailing list