VMatthijs / CHAD

BSD 3-Clause "New" or "Revised" License
21 stars 0 forks source link

Port old combinator implementations of sum types, iteration and recursion to new lambda-calculus style #4

Open VMatthijs opened 3 years ago

VMatthijs commented 3 years ago

Also, some of the array primitives we had?

VMatthijs commented 3 years ago

(No rush, obviously)

tomsmeding commented 3 years ago

As for array primitives, we had only map and foldr before. Not that this is a reason to not have more, but just for posterity.

VMatthijs commented 3 years ago

Right! You did all the other ones (generate, permute, backpermute, indexing) in your own branch with dynamically sized arrays.

VMatthijs commented 2 years ago

@tomsmeding , want to try doing this at least for the sum types, so you can check whether it has the right complexity? That would then give us at least a way of doing AD on higher order programs with the right complexity by using defunctionalization.

tomsmeding commented 2 years ago

Oh that's a good one! I will do so. Slightly longer timeframe than usual perhaps due to lectures that I still need to make...

tomsmeding commented 2 years ago

@VMatthijs Seems to work with the classic LEither, but basically untested: https://github.com/VMatthijs/CHAD/compare/main...sum-types Suggestions for good test cases?