Open meooow25 opened 1 month ago
PS: I find it a little odd that
deepseq
depends onarray
and has to provide these, rather than the other way around.
It should rather be other way around indeed.
I looked into this a bit, and it seems there are two ways we can go about it.
deepseq
provides the instancesThis is simple enough. I can make a PR for it.
deepseq
->array
dependencyIt turns out that the Array
type is defined not in array
, but in base
's GHC.Arr
. So deepseq
never required a dependency on array
in the first place. The steps here are:
deepseq
drops the dependency on array
and provides NFData
for Array
using GHC.Arr
. This is released as version deepseq-x
.array-y
provides NFData
instances for unboxed arrays by taking a dependency on deepseq >= x
. Users of array >= y
get the instances.Sidenote: I found that there was a plan to reverse deepseq
->containers
and deepseq
->array
dependencies in GHC #5468, but they stopped at containers
due to undocumented reasons.
What do you think?
Hi, any thoughts on this?
Given that deepseq
is a dependency of template-haskell
, the former is practically non-reinstallable and such are its dependencies as well, including array
. I think "B. Reverse the deepseq->array dependency" would be most beneficial.
The steps here are:
I think the same could be achieved with automatic Cabal flags: a dependency cycle should be automatically rejected by Cabal solver, forcing flipping a flag. But this requires testing, and being boot packages is likely to complicate things.
(@mixphix is a maintainer here, I'm just passing by)
Could you explain what you mean be automatic Cabal flags? I didn't get that, but then again I'm not too familiar with Cabal stuff.
As I see it, for B the only thing deepseq
needs to do is simply drop the array
dependency. Nothing would be lost with this. Further changes are required only to add new NFData
instances.
Ah, that's even simpler then. I guess the only relevant part of my comment is that array-y
does not even need to demand deepseq >= x
, because Cabal solver would imply such bound automatically to avoid circular dependencies.
NFData instances could be provided for
UArray
,STUArray
andIOUArray
from the array package: https://hackage.haskell.org/package/arrayPS: I find it a little odd that
deepseq
depends onarray
and has to provide these, rather than the other way around.