diff options
| author | aarne <unknown> | 2003-11-13 08:17:28 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2003-11-13 08:17:28 +0000 |
| commit | 25c86905867537f75e9fe2f19759d8747d465590 (patch) | |
| tree | 2914e18ef14e1aad20cdc4c814796360ddd36dea /src/GF/Data/Operations.hs | |
| parent | eb245228482fbf9798ea6ddc01753d5a1e40b2c1 (diff) | |
Field lock in MkResource.
Field lock in MkResource.
Terrible bug fixed in Check Grammar.
Diffstat (limited to 'src/GF/Data/Operations.hs')
| -rw-r--r-- | src/GF/Data/Operations.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/GF/Data/Operations.hs b/src/GF/Data/Operations.hs index d4c13f1f4..08ebdd45c 100644 --- a/src/GF/Data/Operations.hs +++ b/src/GF/Data/Operations.hs @@ -154,14 +154,14 @@ mapP f p = case p of Nope -> Nope -- this is what happens when matching two values in the same module -unifPerhaps :: Perhaps a b -> Perhaps a b -> Err (Perhaps a b) +unifPerhaps :: (Eq a, Eq b) => Perhaps a b -> Perhaps a b -> Err (Perhaps a b) unifPerhaps p1 p2 = case (p1,p2) of (Nope, _) -> return p2 (_, Nope) -> return p1 - _ -> Bad "update conflict" + _ -> if p1==p2 then return p1 else Bad "update conflict" -- this is what happens when updating a module extension -updatePerhaps :: b -> Perhaps a b -> Perhaps a b -> Err (Perhaps a b) +updatePerhaps :: (Eq a,Eq b) => b -> Perhaps a b -> Perhaps a b -> Err (Perhaps a b) updatePerhaps old p1 p2 = case (p1,p2) of (Yes a, Nope) -> return $ may old (May older,Nope) -> return $ may older @@ -169,7 +169,8 @@ updatePerhaps old p1 p2 = case (p1,p2) of _ -> unifPerhaps p1 p2 -- here the value is copied instead of referred to; used for oper types -updatePerhapsHard :: b -> Perhaps a b -> Perhaps a b -> Err (Perhaps a b) +updatePerhapsHard :: (Eq a, Eq b) => b -> + Perhaps a b -> Perhaps a b -> Err (Perhaps a b) updatePerhapsHard old p1 p2 = case (p1,p2) of (Yes a, Nope) -> return $ yes a (May older,Nope) -> return $ may older |
