diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-11-26 23:05:30 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-11-26 23:05:30 +0100 |
commit | ade38c607a8d0dc8dc1d701084ed88df2fa89df9 (patch) | |
tree | 2183d63164a27fe84bb00b6c1920fe6c2be1e0e8 /src/AST/Pretty.hs | |
parent | ae2b1b71a91d60d3bd1dfb21fce98c05c1a4fcbb (diff) |
Working argument accum mode (...)
The derivative of 'neural' in full accum mode is pretty atrocious now; I
think this is because when you have code like this:
\(a :: Arr 1 R) ->
let b = a
in let c = b
in sum d
then because the argument, as well as both let bindings, bind a value of
array type, each will introduce an accumulator, hence resulting in three
(!) nested `with` clauses that each just contribute their result back to
their parent. This is pointless, and we should fix this.
Diffstat (limited to 'src/AST/Pretty.hs')
-rw-r--r-- | src/AST/Pretty.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/AST/Pretty.hs b/src/AST/Pretty.hs index ec8574f..663e9b0 100644 --- a/src/AST/Pretty.hs +++ b/src/AST/Pretty.hs @@ -218,7 +218,7 @@ ppExpr' d val = \case return $ showParen (d > 10) $ showString ("accum " ++ show (fromSNat i) ++ " ") . e1' . showString " " . e2' . showString " " . e3' - EZero _ -> return $ showString "zero" + EZero t -> return $ showString ("(zero :: " ++ ppTy 0 t ++ ")") EPlus _ a b -> do a' <- ppExpr' 11 val a |