diff options
| author | hallgren <hallgren@chalmers.se> | 2014-08-13 22:16:18 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2014-08-13 22:16:18 +0000 |
| commit | cd5193b7e19e7ff5e49cdeafe149fdeec8e19fb0 (patch) | |
| tree | c006a3b453b8b290b09379cf5cb2777421558e70 /src/compiler/GF/Data/ErrM.hs | |
| parent | a06351b6250dd456299565f13eba6ed02dd2a07b (diff) | |
Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8
Diffstat (limited to 'src/compiler/GF/Data/ErrM.hs')
| -rw-r--r-- | src/compiler/GF/Data/ErrM.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/GF/Data/ErrM.hs b/src/compiler/GF/Data/ErrM.hs index e8cea12d4..d687a70a5 100644 --- a/src/compiler/GF/Data/ErrM.hs +++ b/src/compiler/GF/Data/ErrM.hs @@ -14,7 +14,8 @@ module GF.Data.ErrM (Err(..)) where -import Control.Monad (MonadPlus(..)) +import Control.Monad (MonadPlus(..),ap) +import Control.Applicative -- | like @Maybe@ type with error msgs data Err a = Ok a | Bad String @@ -31,8 +32,16 @@ instance Functor Err where fmap f (Ok a) = Ok (f a) fmap f (Bad s) = Bad s +instance Applicative Err where + pure = return + (<*>) = ap + -- | added by KJ instance MonadPlus Err where mzero = Bad "error (no reason given)" mplus (Ok a) _ = Ok a mplus (Bad s) b = b + +instance Alternative Err where + empty = mzero + (<|>) = mplus |
