@@ -187,15 +187,15 @@ optimizeDef cycle def body =
187187
188188optimizeDefHelp :: Cycle -> N.Name -> [Can.Pattern] -> Can.Expr -> Opt.Expr -> Names.Tracker Opt.Expr
189189optimizeDefHelp cycle name args expr body =
190− case args of
191− [] ->
192− do oexpr <- optimize cycle expr
190+ do oexpr <- optimize cycle expr
191+ case args of
192+ [] ->
193193 pure $ Opt.Let (Opt.Def name oexpr) body
194194
195− _ ->
196− do (argNames, destructors) <- destructArgs args
197− let oexpr = Opt.Function argNames (foldr Opt.Destruct body destructors)
198− pure $ Opt.Let (Opt.Def name oexpr) body
195+ _ ->
196+ do (argNames, destructors) <- destructArgs args
197+ let ofunc = Opt.Function argNames (foldr Opt.Destruct oexpr destructors)
198+ pure $ Opt.Let (Opt.Def name ofunc) body
199199
200200
201201