diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-10-22 22:02:18 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-10-22 22:02:18 +0200 |
commit | d6d07f3bf20b4a3c0e51b4414fb0e4538176d294 (patch) | |
tree | 46b1a4e0775dfb812e62bec49c8bf63ef4bf22f6 | |
parent | 79e072eddf0ec2a97ca455c27cb5ff6f2132bbab (diff) |
Less warnings
-rw-r--r-- | src/CHAD.hs | 24 | ||||
-rw-r--r-- | src/Interpreter.hs | 4 |
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 |