Skip to content

Commit

Permalink
use kotlin's tailrec for TCO
Browse files Browse the repository at this point in the history
  • Loading branch information
csicar committed Sep 21, 2019
1 parent 50ea344 commit 5b610a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ToDos
- [x] Build cache
- [x] use Shake
- [x] `--run` for spago CLI spec
- [ ] TCO
- [x] TCO: through Kotlin's `tailrec`
- [ ] expand inlining
- [x] `$`
- [ ] `>`, `>=` ...
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGen/Printer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ printExprAlg (LambdaF arg (_, body)) = braces $ (<> line') $ nest' $
printExprAlg (DeferF (Stmt _, body)) = "/* defer **/" <> body
printExprAlg (DeferF (_, body)) = ("/* defer */" <>) $ braces $ nest' body
printExprAlg (FunF mName args (_, body)) =
"fun" <+> maybe "" printKtIdent mName <> parens (commaSep $ (<+> ": Any") . printKtIdent <$> args) <> ": Any =" <+> body
"tailrec fun" <+> maybe "" printKtIdent mName <> parens (commaSep $ (<+> ": Any") . printKtIdent <$> args) <> ": Any =" <+> body
printExprAlg (PropertyF (_, a) (_, b)) = align $ nest' $ a <> line' <> "." <> b
printExprAlg (FunRefF qualIdent) = parens $ "::" <> printQualified printKtIdent qualIdent
printExprAlg (ConstF lit) = printLiteral lit
Expand Down

0 comments on commit 5b610a3

Please sign in to comment.