summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Data/Operations.hs
diff options
context:
space:
mode:
authorAndreas Källberg <anka.213@gmail.com>2020-09-05 20:23:07 +0200
committerAndreas Källberg <anka.213@gmail.com>2020-09-05 20:23:07 +0200
commit7268253f5ae4b4883d28faa87b3e63295f04abfd (patch)
treefb95bb40e3f8dece1deb018857b948a645003993 /src/compiler/GF/Data/Operations.hs
parent1234c715fc6fe19d0c9fce794e4dfedf190b8d18 (diff)
MonadFail: Make backwards-compatible
Diffstat (limited to 'src/compiler/GF/Data/Operations.hs')
-rw-r--r--src/compiler/GF/Data/Operations.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/GF/Data/Operations.hs b/src/compiler/GF/Data/Operations.hs
index a9fedcaff..08fa15c3e 100644
--- a/src/compiler/GF/Data/Operations.hs
+++ b/src/compiler/GF/Data/Operations.hs
@@ -53,6 +53,7 @@ import Control.Monad (liftM,liftM2) --,ap
import GF.Data.ErrM
import GF.Data.Relation
+import qualified Control.Monad.Fail as Fail
infixr 5 +++
infixr 5 ++-
@@ -88,10 +89,10 @@ checkUnique ss = ["overloaded" +++ show s | s <- nub overloads] where
overloaded s = length (filter (==s) ss) > 1
-- | this is what happens when matching two values in the same module
-unifyMaybe :: (Eq a, MonadFail m) => Maybe a -> Maybe a -> m (Maybe a)
+unifyMaybe :: (Eq a, Fail.MonadFail m) => Maybe a -> Maybe a -> m (Maybe a)
unifyMaybe = unifyMaybeBy id
-unifyMaybeBy :: (Eq b, MonadFail m) => (a->b) -> Maybe a -> Maybe a -> m (Maybe a)
+unifyMaybeBy :: (Eq b, Fail.MonadFail m) => (a->b) -> Maybe a -> Maybe a -> m (Maybe a)
unifyMaybeBy f (Just p1) (Just p2)
| f p1==f p2 = return (Just p1)
| otherwise = fail ""