We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In a quick experiment, the following definition runs circles around the current implementation of upTo
upTo
goUpTo : ℕ → ℕ → List ℕ goUpTo _ 0 = [] goUpTo n (suc i) = n ∷ goUpTo (suc n) i upTo′ : ℕ → List ℕ upTo′ = goUpTo 0
I suspect this is because applyUpTo builds huge closures.
applyUpTo
The text was updated successfully, but these errors were encountered:
(Deleted my original comment, but now reinstating it) Can the implementation be further improved/speeded-up by considering a tail-call optimisation?
Sorry, something went wrong.
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.
#679 _safe
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...
No branches or pull requests
In a quick experiment, the following definition runs circles around the current implementation of
upTo
I suspect this is because
applyUpTo
builds huge closures.The text was updated successfully, but these errors were encountered: