Open Taneb opened 1 month ago
(Deleted my original comment, but now reinstating it) Can the implementation be further improved/speeded-up by considering a tail-call optimisation?
Can the implementation be further improved/speeded-up by considering a tail-call optimisation?
I don't think so. The recursion here is already guarded behind a constructor. I don't know what a tail recursive implementation would look like.
module base where
open import Funnction public using(id:$$-**)
Eq public using(—=——;refl)
@linyue0103 not sure I understand your comment, nor how it applies to this issue?
Yes, I never had performance in mind when I add any of my definitions. Apologies! There's probably plenty more of these lurking in the library...
In a quick experiment, the following definition runs circles around the current implementation of
upTo
I suspect this is because
applyUpTo
builds huge closures.