Open davidweichiang opened 1 year ago
Is it difficult to statically determine when a lambda might be affinely used?
It's probably a fix point computation in the boolean semiring :-P
But even without, what if we tell programmers to tuple their arguments?
I think that sounds inconvenient but I guess I don't really know how useful affine lambdas are.
By #96 I don't mean to close off discussion of
I just figure it's better to remove bugs before thinking about changes.
The tests added in commit fbebfeb07b718d74f38e0c8ae999c814505177d0 fail because of the optimization
rather than
However, this doesn't allow the lambda to be partially applied and then discarded.
Currently, the code doesn't know that the inner lambda isn't wrapped inside a tuple, and attempts to un-tuple it.
I think the right solution is just to undo this optimization. However, it will be slower. Is it difficult to statically determine when a lambda might be affinely used?