data-default icon indicating copy to clipboard operation
data-default copied to clipboard

Merge packages data-default-class and data-default-instances-base

Open sol opened this issue 11 years ago • 5 comments

I may be missing something, but as I see it the reason to split the original data-default into separate packages is to minimize dependencies.

As both data-default-class and data-default-instances-base only introduce the base dependency, we could merge the packages.

Keeping the separate packages has the downside that the instances in data-default-instances-base are orphan (which I generally considered undesirable). Are there any upsides?

sol avatar Aug 27 '14 04:08 sol

+1

I'll add data-default-instances-containers and data-default-instances-old-locale as well, as the corresponding packages come bundled with GHC anyway.

Given that dlist is the only dependency which isn't pre-installed, I'm starting to question the reasoning behind splitting data-default in the first place.

lambda-fairy avatar Sep 12 '14 04:09 lambda-fairy

I agree with @sol. I have always avoided the Default class in this package entirely because of the dlist dependency, which seemed totally gratuitous. But nowadays both old-locale and containers are both weird dependencies to have, and not required by many packages (the fact they are shipped with GHC is mostly historical). Merging data-default-class and data-default-instances-base keeps the dependencies light (which is what you expect for a package that defines only one trivial class).

As concrete examples, I'd love to use the union of data-default-class and data-default-instances-base in both CmdArgs and Shake, but would only do so if there was one package, that required only base, and that defined both the class and instances for the base types.

ndmitchell avatar Sep 23 '14 09:09 ndmitchell

@lfairy I think it is preferable to only have base as a dependency for data-default and keep the other instances (containers, dlist, old-locale) orphan. Every dependency adds a cost, so minimizing dependencies for data-default makes it ultimately more useful.

BTW, similar to @ndmitchell I would love to use data-default for hspec if we resolve this issue.

sol avatar Sep 24 '14 03:09 sol

What would be the best way to merge them? Move all the code from ...-instances-base into ...-class and have ...-instances-base depend on ...-class (reexporting the instances)?

mauke avatar Apr 17 '16 21:04 mauke

@mauke That seems reasonable to me.

lambda-fairy avatar Apr 18 '16 01:04 lambda-fairy