1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 14:13:27 +03:00
juvix/tests/Compilation
Łukasz Czajka 34b5a14935
Improve the specialisation optimisation (#2417)
* Closes #2416 
* Closes #2401 
* Avoids generating identical specialisations by keeping a
specialisation signature for each specialised function application.
* Allows to specialise on a per-trait or per-instance basis:
```
{-# specialize: true #-}
trait
type Natural N := mkNatural {
  + : N -> N -> N;
  * : N -> N -> N;
  fromNat : Nat -> N;
};
```
or
```
{-# specialize: true #-}
instance
naturalNatI : Natural Nat := ...
```
* The above `specialize: bool` pragma actually works with any type or
function. To be able to simultaneously specify the boolean
specialisation flag and specialisation arguments, one can use
`specialize-args: [arg1, .., argn]` which works like `specialize: [arg1,
.., argn]`.
2023-10-05 10:12:48 +02:00
..
negative Remove old function syntax (#2305) 2023-08-24 16:24:47 +02:00
positive Improve the specialisation optimisation (#2417) 2023-10-05 10:12:48 +02:00