summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Update.hs
diff options
context:
space:
mode:
authoraarne <unknown>2003-10-01 12:46:44 +0000
committeraarne <unknown>2003-10-01 12:46:44 +0000
commitc985dab565416251d9973f5b3bafe4d9d205b249 (patch)
treeada69513d8a20338af8058d35ce2bc75e5495d4b /src/GF/Compile/Update.hs
parent8ed7749eb674e3afe4485cfb3d4d50485a2cf097 (diff)
Putting def definitions in place.
Diffstat (limited to 'src/GF/Compile/Update.hs')
-rw-r--r--src/GF/Compile/Update.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/GF/Compile/Update.hs b/src/GF/Compile/Update.hs
index 9bc16f03a..4eb4849ef 100644
--- a/src/GF/Compile/Update.hs
+++ b/src/GF/Compile/Update.hs
@@ -36,9 +36,9 @@ combineAnyInfos = combineInfos unifyAnyInfo
unifyAnyInfo :: Ident -> Info -> Info -> Err Info
unifyAnyInfo c i j = errIn ("combining information for" +++ prt c) $ case (i,j) of
(AbsCat mc1 mf1, AbsCat mc2 mf2) ->
- liftM2 AbsCat (unifPerhaps mc1 mc2) (unifPerhaps mf1 mf2) ---- adding constrs
+ liftM2 AbsCat (unifPerhaps mc1 mc2) (unifConstrs mf1 mf2) -- adding constrs
(AbsFun mt1 md1, AbsFun mt2 md2) ->
- liftM2 AbsFun (unifPerhaps mt1 mt2) (unifAbsDefs md1 md2) ---- adding defs
+ liftM2 AbsFun (unifPerhaps mt1 mt2) (unifAbsDefs md1 md2) -- adding defs
(ResParam mt1, ResParam mt2) -> liftM ResParam $ unifPerhaps mt1 mt2
(ResOper mt1 m1, ResOper mt2 m2) ->
@@ -95,4 +95,11 @@ unifAbsDefs p1 p2 = case (p1,p2) of
(Nope, _) -> return p2
(_, Nope) -> return p1
(Yes (Eqs bs), Yes (Eqs ds)) -> return $ yes $ Eqs $ bs ++ ds --- order!
- _ -> Bad "update conflict"
+ _ -> Bad "update conflict for definitions"
+
+unifConstrs :: Perh [Term] -> Perh [Term] -> Err (Perh [Term])
+unifConstrs p1 p2 = case (p1,p2) of
+ (Nope, _) -> return p2
+ (_, Nope) -> return p1
+ (Yes bs, Yes ds) -> return $ yes $ bs ++ ds
+ _ -> Bad "update conflict for constructors"