Closed utdemir closed 2 years ago
@sw17ch, friendly ping :). Is there anything I can do to get this PR move forward?
Sorry for the delays. I haven't been active in the Haskell community for some time, but I was able to review this, and confirm it builds and passes tests for me locally. I'll merge this as is, and see if I can figure out how to push a new package to Hackage. Thank you.
New package uploaded at https://hackage.haskell.org/package/data-clist-0.2
Thank you @sw17ch , I really appreciate this :).
sorry it took so long. :)
I think this closes #16. It also conflicts with #12 a bit (I guess it's fine because that issue is 5 years old).
Previously, the library itself used to depend on QuickCheck, because the 'Arbitrary' instance was defined in the main library. This is not ideal since QuickCheck itself is a relatively heavy library, so large amount of dependency footprint introduced by
data-clist
is actually justQuickCheck
.In order to remove the dependency, this commit does the following:
Introduce 'Data.CircularList.Internal':
This is because the 'Arbitrary' instance uses the constructor which isn't exported. In order to keep the interface clean, I created an internal module which exports everything and the original module re-exports the proper interface.
Move the 'Arbitrary' instance under 'tests/':
It is an orphan instance, but I don't think it's a big problem since there is no other module depending on the tests. This also means that the 'Arbitrary' insance is now not exported, which is a breaking change. But practically it shouldn't be a big issue, because it can easily be changed with
fromList <$> arbitrary
. I think reducing the dependency footprint is worth the trade-off here.Actually create a cabal 'test-suite':
Previously the tests weren't invoked via 'cabal'. In order to provide a way to obtain 'QuickCheck' without depending on it from the base library, I introduced a cabal test suite which should only pull in 'QuickCheck' when running tests.
This required me to increase the cabal lower bound. I couldn't determine precisely what this means, but I think it still is pretty old.