Closed pniedzielski closed 3 years ago
Hi @pa-ba, I'd just like to follow up on this. Having compdata fail to compile on recent GHCs is a blocker for me, and it seems several other people.
Hi @pa-ba, I'm just checking in on this. Having a compiling compdata
on Hackage is the only blocking issue from uploading my own package there.
Hi @pniedzielski, many thanks for the PR! Sorry about the long wait. I'll push the update to Hackage shortly.
Thanks, @pa-ba !
This PR fixes issue #29, and related issues that arose, but were not described by that issue. This will also unblock issue #32, which is a result of the failing compilation on recent GHCs.
Background
The acceptance of the
MonadFail
proposal resulted in a breaking change in GHC 8.8.1 and onward, with an earlier migration period in older versions ofbase
, in whichMonad
'sfail
function is moved to a new class,MonadFail
. In earlier GHCs,Monad
maintains itsfail
function for backwards compatibility, andMonadFail
is defined in a separate moduleControl.Monad.Fail
. With GHC 8.8.1, thefail
function is removed fromMonad
, andMonadFail
is exported fromPrelude
. What this means for us is thatcompdata
and its benchmarks and examples fail to compile on these newer GHCs.There have been two PRs to fix this issue already:
base
, which would limit us to only compiling on very recent GHCs, andNeither of these PRs fix the complete problem though, as they only change the
Data.Comp.Thunk
module, not the same issues that crop up in the benchmarks and the examples.This PR
The changes in this PR fix all the compilation errors and warnings related to the
MonadFail
proposal in 8.x-series GHCs by selectively importing theControl.Monad.Fail
module, depending on the version ofbase
, and addingMonadFail
constraints where necessary. To make sure our changes compile properly, we add newer GHCs to our travisci test matrix.We also bump the required version of
base
to the one that started theMonadFail
migration. We think this is licensed, because we are already usingMonadFail
in parts of the code (which presumably caused a failure in compilation on GHC 7.x), and because commit fe05efb explicitly removes earlier GHCs from the test matrix. If we want to support earlier versions of GHC, we can introduce a dependency on thefail
package.Testing
This PR compiles without warnings on all tested 8.x-series GHCs: https://travis-ci.com/github/pniedzielski/compdata/builds/193484821