-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing build with MonadFailDesugaring #80
Conversation
.travis.yml
Outdated
@@ -38,6 +38,15 @@ matrix: | |||
- env: CABALVER=1.24 GHCVER=8.0.1 | |||
compiler: ": #GHC 8.0.1" | |||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}} | |||
- env: CABALVER=1.24 GHCVER=8.2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add these into the .cabal file as well please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added these to to the tested-with
field of fgl.cabal
.
Data/Graph/Inductive/Monad.hs
Outdated
@@ -1,3 +1,4 @@ | |||
{-# LANGUAGE CPP #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge this into the next line:
{-# LANGUAGE CPP, MultiParamTypeClasses #-}
@@ -39,7 +44,11 @@ import Data.Graph.Inductive.Graph | |||
|
|||
-- Monadic Graph | |||
-- | |||
#if MIN_VERSION_base(4,12,0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to make this a little less intrusive is to have something like:
class
#if MIN_VERSION_base(4,12,0)
(MonadFail m)
#else
(Monad m)
#endif
=> GraphM m gr where
The advantage of this approach is that you can ensure that GraphM
is defined regardless in the same way, just that the constraint differs.
I don't mind CPP; I've had to use it enough times myself :/ If nothing else, this PR has also pointed out to me that I may need to re-implement the benchmarks away from |
d6735ce
to
344a7e4
Compare
I try to avoid CPP if I can and like to let people know when I've added it. I applied your code review suggestions and squashed the commits. |
Should be ready to merge. |
Ping? |
Sorry, work has been rather busy so I haven't had a chance to look at it.
Hopefully next week.
On mobile; please excuse any tpyos.
…On Thu, 27 Sep. 2018, 10:57 pm Peter Simons, ***@***.***> wrote:
Ping?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#80 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAwXc_F1KmibGRiqf2MiYYknipypmkicks5ufOdngaJpZM4WFFNo>
.
|
.travis.yml
Outdated
addons: {apt: {packages: [cabal-install-1.24,ghc-8.4.3], sources: [hvr-ghc]}} | ||
- env: CABALVER=1.24 GHCVER=8.6.1 | ||
compiler: ": #GHC 8.6.1" | ||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.6.1], sources: [hvr-ghc]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use cabal-install-2.4
for GHC-8.6.1, 2.2 for 8.4, 2.0 for 8.2. Otherwise things may fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the cabal versions to match the newer ghc versions.
@@ -19,6 +19,10 @@ module Data.Graph.Inductive.Monad( | |||
|
|||
|
|||
import Data.Graph.Inductive.Graph | |||
#if MIN_VERSION_base(4,12,0) | |||
import Control.Monad.Fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommended way is to depend on fail
package, then you can provide uniform interface across different GHC versions
- http://hackage.haskell.org/package/fail
- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0#base-4.9.0.0
In general https://ghc.haskell.org/trac/ghc/wiki/Migration/8.6 and other migration guides are good reads.
Note that changing context of a class is breaking change, requiring a major bump to fgl-5.7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely correct that this is a breaking change and I've bumped the version to fgl-5.7
to reflect that along with updating the changelog.
I was also unaware of the fail
package. I'm happy to also update fgl
to depend on the fail
package and remove the CPP I had to add in lieu of that solution. However, I want to get feedback from @ivan-m to make sure that's their preferred way for fgl
to support the MonadFail
constraint on the GraphM
typeclass.
@recursion-ninja if you think breaking change is better way, could you depend on It would be very surprising for downstream if when upgrading to GHC-8.6 they need to write MonadFail instance for their monad (if someone is so silly that doesn't use IO or ST directly). |
I prefer to keep FGL depending solely on boot packages. |
@ivan-m, so we'll stick with the CPP and not depend on the Since that's the case, this should be ready to merge. |
Is there a time line for merging this? I'd like it to be able to use the |
@recursion-ninja as a temporary workaround you could use: source-repository-package
type: git
location: https://github.com/recursion-ninja/fgl.git
tag: d49cd7b0cd766d9f4647e140e263de1b94ace0c5
in your |
@martijnbastiaan that is a nice, temporary solution. However, this pull request should be merged and a new version of |
Does someone have the time to initiate a non-maintainer upload request as per https://wiki.haskell.org/Hackage_trustees? |
Sorry, this slipped my mind; I'll do it this weekend. |
I'm not sure why Travis-CI didn't catch this, but this actually fails with cabal-install-2.4 due to the deprecation of grumbles |
@ivan-m, cabal-install-2.4 print the warning, but it doesn't fail.
…Sent from my iPhone
On 13 Nov 2018, at 17.11, Ivan Lazar Miljenovic ***@***.***> wrote:
I'm not sure why Travis-CI didn't catch this, but this actually fails with cabal-install-2.4 due to the deprecation of cabal install.
grumbles
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sorry, you're right; I fail at reading error messages. |
This resolves #79.
I had to use CPP for conditional imports and constraints, which is ugly, but not too intrusive.