summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CHAD.hs24
-rw-r--r--src/Interpreter.hs4
2 files changed, 12 insertions, 16 deletions
diff --git a/src/CHAD.hs b/src/CHAD.hs
index 786de07..4694ac4 100644
--- a/src/CHAD.hs
+++ b/src/CHAD.hs
@@ -295,18 +295,18 @@ plus = EPlus
-- STBool -> ENil ext
-- plus STAccum{} _ _ = error "Accumulators not allowed in input program"
-plusSparse :: STy a
- -> Ex env (TEither TNil a) -> Ex env (TEither TNil a)
- -> Ex (a : a : env) a
- -> Ex env (TEither TNil a)
-plusSparse t a b adder =
- ELet ext b $
- ECase ext (weakenExpr WSink a)
- (EVar ext (STEither STNil t) (IS IZ))
- (EInr ext STNil
- (ECase ext (EVar ext (STEither STNil t) (IS IZ))
- (EVar ext t (IS IZ))
- (weakenExpr (WCopy (WCopy WSink)) adder)))
+-- plusSparse :: STy a
+-- -> Ex env (TEither TNil a) -> Ex env (TEither TNil a)
+-- -> Ex (a : a : env) a
+-- -> Ex env (TEither TNil a)
+-- plusSparse t a b adder =
+-- ELet ext b $
+-- ECase ext (weakenExpr WSink a)
+-- (EVar ext (STEither STNil t) (IS IZ))
+-- (EInr ext STNil
+-- (ECase ext (EVar ext (STEither STNil t) (IS IZ))
+-- (EVar ext t (IS IZ))
+-- (weakenExpr (WCopy (WCopy WSink)) adder)))
zeroTup :: SList STy env0 -> Ex env (Tup (D2E env0))
zeroTup SNil = ENil ext
diff --git a/src/Interpreter.hs b/src/Interpreter.hs
index b818eb0..7be1c4b 100644
--- a/src/Interpreter.hs
+++ b/src/Interpreter.hs
@@ -473,7 +473,3 @@ ixUncons (IxCons idx i) = (idx, i)
shUncons :: Shape (S n) -> (Shape n, Int)
shUncons (ShCons idx i) = (idx, i)
-
-foldl1M :: Monad m => (a -> a -> m a) -> [a] -> m a
-foldl1M _ [] = error "foldl1M: empty list"
-foldl1M f (tophead : toptail) = foldM f tophead toptail