Closed davidweichiang closed 1 year ago
I think this is working but probably will want to add a few more tests to be sure.
Towards the end of making the compiler able to parse its own -c output, I allowed <>
in source code and gave it type AdditiveUnit
. Totally open to better ways to write AdditiveUnit
.
This is passing all of the new sum-product tests. But it's noticeably slower than before.
"Noticeably slower" = 3.25x slower.
A trivial comment: AdditiveUnit is usually called Zero.
A trivial comment: AdditiveUnit is usually called Zero. Correction: Girard calls it $\top$
OK, now this passes all tests and the test that originally motivated this.
@ccshan if you want to approve this instead of @HerbertMcSnout I think that would be fine.
But nonrecursive datatypes are already positive (robust)...why would we want to generate the extra code?
But nonrecursive datatypes are already positive (robust)...why would we want to generate the extra code?
To clarify, I mostly just thought that it would be nice to not rely on isRecursiveTypeName
. Also, some nonrecursive datatypes are nonpositive: data T = MkT (Bool -> Bool)
Just a suggestion...
OK, I see, that saves a lot of code. I pushed a change in master that takes your suggestion, but suppresses generation of the discard function for positive datatypes.
Closes #54