diff options
| author | aarne <unknown> | 2005-02-04 19:17:57 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2005-02-04 19:17:57 +0000 |
| commit | bc05653e825e082b70eebf2f420eb5a97610f56c (patch) | |
| tree | 66ddf9b72422f08f09f1b5a86a1bcd838d92baee /src/GF/Data/Operations.hs | |
| parent | b8b5139a8a8f8b0451061bacefc033b0bc768886 (diff) | |
resources and new instantiation syntax
Diffstat (limited to 'src/GF/Data/Operations.hs')
| -rw-r--r-- | src/GF/Data/Operations.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/GF/Data/Operations.hs b/src/GF/Data/Operations.hs index 214509142..1b656f52c 100644 --- a/src/GF/Data/Operations.hs +++ b/src/GF/Data/Operations.hs @@ -192,14 +192,17 @@ mapP f p = case p of Nope -> Nope -- this is what happens when matching two values in the same module -unifPerhaps :: (Eq a, Eq b) => Perhaps a b -> Perhaps a b -> Err (Perhaps a b) +unifPerhaps :: (Eq a, Eq b, Show a, Show b) => + Perhaps a b -> Perhaps a b -> Err (Perhaps a b) unifPerhaps p1 p2 = case (p1,p2) of (Nope, _) -> return p2 (_, Nope) -> return p1 - _ -> if p1==p2 then return p1 else Bad "update conflict" + _ -> if p1==p2 then return p1 + else Bad ("update conflict between" ++++ show p1 ++++ show p2) -- this is what happens when updating a module extension -updatePerhaps :: (Eq a,Eq b) => b -> Perhaps a b -> Perhaps a b -> Err (Perhaps a b) +updatePerhaps :: (Eq a,Eq b, Show a, Show 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 @@ -207,7 +210,7 @@ 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 :: (Eq a, Eq b) => b -> +updatePerhapsHard :: (Eq a, Eq b, Show a, Show 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 |
