diff options
-rw-r--r-- | src/AST/UnMonoid.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/AST/UnMonoid.hs b/src/AST/UnMonoid.hs index ef01bf8..48dd709 100644 --- a/src/AST/UnMonoid.hs +++ b/src/AST/UnMonoid.hs @@ -60,7 +60,8 @@ unMonoid = \case EError _ t s -> EError ext t s zero :: SMTy t -> Ex env (ZeroInfo t) -> Ex env t -zero SMTNil e = elet e $ ENil ext +-- don't destroy the effects! +zero SMTNil e = ELet ext e $ ENil ext zero (SMTPair t1 t2) e = ELet ext e $ EPair ext (zero t1 (EFst ext (EVar ext (typeOf e) IZ))) (zero t2 (ESnd ext (EVar ext (typeOf e) IZ))) @@ -96,7 +97,7 @@ deepZero (SMTScal t) _ = case t of plus :: SMTy t -> Ex env t -> Ex env t -> Ex env t -- don't destroy the effects! -plus SMTNil a b = elet a $ elet (weakenExpr WSink b) $ ENil ext +plus SMTNil a b = ELet ext a $ ELet ext (weakenExpr WSink b) $ ENil ext plus (SMTPair t1 t2) a b = let t = STPair (fromSMTy t1) (fromSMTy t2) in ELet ext a $ |