From 4e9957bda4d983d667ad8a86013d766b2e013623 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 14 Feb 2026 18:03:28 +0100 Subject: WIP --- src/CHAD/AST/UnMonoid.hs | 14 ++++++++------ 1 file 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 -- cgit v1.2.3-70-g09d2