From 344a7e452630ace0f5c647e525e0299d99de5902 Mon Sep 17 00:00:00 2001 From: Alex Washburn Date: Mon, 20 Aug 2018 23:46:32 -0400 Subject: [PATCH 1/3] Fixing issue with MonadFailDesugaring. --- .travis.yml | 9 +++++++++ Data/Graph/Inductive/Monad.hs | 14 ++++++++++++-- fgl.cabal | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index db5eeb1..f026dd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 + compiler: ": #GHC 8.2.2" + addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2], sources: [hvr-ghc]}} + - env: CABALVER=1.24 GHCVER=8.4.3 + compiler: ": #GHC 8.4.3" + 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]}} - env: CABALVER=head GHCVER=head compiler: ": #GHC head" addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} diff --git a/Data/Graph/Inductive/Monad.hs b/Data/Graph/Inductive/Monad.hs index 1d58af0..d63752b 100644 --- a/Data/Graph/Inductive/Monad.hs +++ b/Data/Graph/Inductive/Monad.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE CPP, MultiParamTypeClasses #-} -- (c) 2002 by Martin Erwig [see file COPYRIGHT] -- | Monadic Graphs @@ -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 +import Prelude hiding (fail) +#endif {-# ANN module "HLint: ignore Redundant lambda" #-} @@ -39,7 +43,13 @@ import Data.Graph.Inductive.Graph -- Monadic Graph -- -class (Monad m) => GraphM m gr where +class +#if MIN_VERSION_base(4,12,0) + (MonadFail m) +#else + (Monad m) +#endif + => GraphM m gr where {-# MINIMAL emptyM, isEmptyM, matchM, mkGraphM, labNodesM #-} emptyM :: m (gr a b) diff --git a/fgl.cabal b/fgl.cabal index 4251a21..4b2a039 100644 --- a/fgl.cabal +++ b/fgl.cabal @@ -18,7 +18,8 @@ extra-source-files: ChangeLog tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3, - GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1, GHC == 8.1.* + GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1, GHC == 8.2.2, + GHC == 8.4.3, GHC == 8.6.1 source-repository head type: git From 0c795fe63c5b519ae9fe3ff97d940cf94d80d19e Mon Sep 17 00:00:00 2001 From: Alex Washburn Date: Sun, 30 Sep 2018 15:10:42 -0400 Subject: [PATCH 2/3] Correcting the cabal versions to match newer ghc versions. --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f026dd1..0300c18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,15 +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 + - env: CABALVER=2.0 GHCVER=8.2.2 compiler: ": #GHC 8.2.2" - addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=8.4.3 + addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}} + - env: CABALVER=2.2 GHCVER=8.4.3 compiler: ": #GHC 8.4.3" - addons: {apt: {packages: [cabal-install-1.24,ghc-8.4.3], sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=8.6.1 + addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}} + - env: CABALVER=2.4 GHCVER=8.6.1 compiler: ": #GHC 8.6.1" - addons: {apt: {packages: [cabal-install-1.24,ghc-8.6.1], sources: [hvr-ghc]}} + addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}} - env: CABALVER=head GHCVER=head compiler: ": #GHC head" addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} From d49cd7b0cd766d9f4647e140e263de1b94ace0c5 Mon Sep 17 00:00:00 2001 From: Alex Washburn Date: Sun, 30 Sep 2018 15:25:13 -0400 Subject: [PATCH 3/3] Updating version and changelog in the presence of a breaking change. [skip ci] --- ChangeLog | 6 ++++++ fgl.cabal | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6304e5a..2df5ec8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +5.7.0.0 +------- + +* Updating the GraphM class to be compatible with the MonadFail proposal and GHC's + MonadFailDesugaring language extension which is enabled by default by GHC-8.6.1. + 5.6.0.0 ------- diff --git a/fgl.cabal b/fgl.cabal index 4b2a039..b9b9fbf 100644 --- a/fgl.cabal +++ b/fgl.cabal @@ -1,5 +1,5 @@ name: fgl -version: 5.6.0.0 +version: 5.7.0.0 license: BSD3 license-file: LICENSE author: Martin Erwig, Ivan Lazar Miljenovic