johnynek / bosatsu

A python-ish pure and total functional programming language
Apache License 2.0
223 stars 11 forks source link

define tuples up to 32 #1078

Closed johnynek closed 8 months ago

johnynek commented 8 months ago

relates to #1026 #1029

If we only have functions up to 32, then we can only have types with up to 32 parameters (otherwise their constructors are unrepresentable). So, this removes the cons-cell encoding of variadic tuples and adds 32 concrete tuples.

This should improve runtime performance of tuple heavy code, but I have not benchmarked it.

I could also have implemented this by adding the types and constructor functions directly to the post-source converted code. That may improve test performance (that winds up compiling the predef a lot, but in practice I don't think it would matter, plus it hides the structure and name of the parameters in a harder to see place and makes more types magical).

codecov-commenter commented 8 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (52d452f) 92.37% compared to head (c1b74f5) 92.38%.

Files Patch % Lines
...e/src/main/scala/org/bykn/bosatsu/PackageMap.scala 0.00% 4 Missing :warning:
.../main/scala/org/bykn/bosatsu/SourceConverter.scala 96.96% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1078 +/- ## ========================================== + Coverage 92.37% 92.38% +0.01% ========================================== Files 93 93 Lines 10277 10306 +29 Branches 2413 2388 -25 ========================================== + Hits 9493 9521 +28 - Misses 784 785 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.