aboutsummaryrefslogtreecommitdiff
path: root/src/CHAD/AST/UnMonoid.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CHAD/AST/UnMonoid.hs')
-rw-r--r--src/CHAD/AST/UnMonoid.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/CHAD/AST/UnMonoid.hs b/src/CHAD/AST/UnMonoid.hs
index ceb10de..cd6467c 100644
--- a/src/CHAD/AST/UnMonoid.hs
+++ b/src/CHAD/AST/UnMonoid.hs
@@ -143,8 +143,8 @@ unMonoid = \case
EOp _ op e -> EOp ext op (unMonoid e)
ECustom _ t1 t2 t3 a b c e1 e2 -> ECustom ext (tUnMonoid t1) (tUnMonoid t2) (tUnMonoid t3) (unMonoid a) (unMonoid b) (unMonoid c) (unMonoid e1) (unMonoid e2)
ERecompute _ e -> ERecompute ext (unMonoid e)
- EWith _ t a b -> EWith ext t (unMonoid a) (unMonoid b)
- EError _ t s -> EError ext t s
+ EWith _ t a b -> EWith ext (mtUnMonoid t) (unMonoid a) (unMonoid b)
+ EError _ t s -> EError ext (tUnMonoid t) s
zero :: SMTy t -> Ex env (ZeroInfo t) -> Ex env (UnMonoid t)
-- don't destroy the effects!
@@ -289,11 +289,13 @@ accumulateSparse topty topsp arg accum = case (topty, topsp) of
(EIdx ext (evar (IS IZ)) (EVar ext tn IZ))
(\w prj idx val -> accum (WPop (WPop w)) (SAPArrIdx prj) (EPair ext (EVar ext tn (w @> IZ)) idx) val)) $
ENil ext
- (SMTArr _ t, SpArrIdx s) ->
+ (SMTArr n t, SpArrIdx SNil) -> _
+ (SMTArr n t, SpArrIdx (s `SCons` l)) ->
eunPair arg $ \w1 e1 e2 ->
- elet (accumulateSparse t s e2
- (\w prj idx val -> accum (w .> w1) (SAPArrIdx prj) (EPair ext (weakenExpr w e1) idx) val)) $
- ENil ext
+ _
+ -- elet (accumulateSparse t s e2
+ -- (\w prj idx val -> accum (w .> w1) (SAPArrIdx prj) (EPair ext (weakenExpr w e1) idx) val)) $
+ -- ENil ext
acPrjCompose
:: SAIDense dense