diff options
| author | John J. Camilleri <john@johnjcamilleri.com> | 2020-09-14 22:42:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-14 22:42:37 +0200 |
| commit | 6c54e5b63cb563d780843a1970cba0718a5203f8 (patch) | |
| tree | ed6777f6cb20f9212fa29ce68fac7e22745c707c /src/tools | |
| parent | bca0691cb028fe33ae1b77e71752d4e937490ff1 (diff) | |
| parent | 8bcdeedba01847325cc89378fed114bc0561bd4d (diff) | |
Merge pull request #71 from anka-213/fix-newer-cabal
Fix support for newer stackage snapshots
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/c/GFCC/ErrM.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tools/c/GFCC/ErrM.hs b/src/tools/c/GFCC/ErrM.hs index 820473ccd..78295d30e 100644 --- a/src/tools/c/GFCC/ErrM.hs +++ b/src/tools/c/GFCC/ErrM.hs @@ -4,6 +4,10 @@ -- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. module GFCC.ErrM where +-- Control.Monad.Fail import will become redundant in GHC 8.8+ +import qualified Control.Monad.Fail as Fail + + -- the Error monad: like Maybe type with error msgs data Err a = Ok a | Bad String @@ -11,6 +15,13 @@ data Err a = Ok a | Bad String instance Monad Err where return = Ok - fail = Bad Ok a >>= f = f a Bad s >>= f = Bad s + +#if !(MIN_VERSION_base(4,13,0)) + fail = Bad +#endif + +instance Fail.MonadFail Err where + fail = Bad + |
