mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 01:52:11 +03:00
8aa54ecc28
* Closes #1989 * Adds optimization phases to the pipline (specified by `opt-phase-eval`, `opt-phase-exec` and `opt-phase-geb` transformations). * Adds the `-O` option to the `compile` command to specify the optimization level. * Functions can be declared for inlining with the `inline` pragma: ``` {-# inline: true #-} const : {A B : Type} -> A -> B -> A; const x _ := x; ``` By default, the function is inlined only if it's fully applied. One can specify that a function (partially) applied to at least `n` explicit arguments should be inlined. ``` {-# inline: 2 #-} compose : {A B C : Type} -> (B -> C) -> (A -> B) -> A -> C; compose f g x := f (g x); ``` Then `compose f g` will be inlined, even though it's not fully applied. But `compose f` won't be inlined. * Non-recursive fully applied functions are automatically inlined if the height of the body term does not exceed the inlining depth limit, which can be specified with the `--inline` option to the `compile` command. * The pragma `inline: false` disables automatic inlining on a per-function basis. |
||
---|---|---|
.. | ||
Compile | ||
Dev | ||
Doctor | ||
Eval | ||
Extra | ||
Format | ||
Html | ||
Repl | ||
Typecheck | ||
Base.hs | ||
Clean.hs | ||
Compile.hs | ||
Dev.hs | ||
Doctor.hs | ||
Eval.hs | ||
Format.hs | ||
Html.hs | ||
Init.hs | ||
Repl.hs | ||
Typecheck.hs |