Conversation
This version has a better runtime representation This version lets us have efficient implementations of things like splitAt and quotRem
|
I think that this all looks great (but see also #2257 and #2292 which took a different angle of attack, focusing on modular arithmetic), but I'm a bit concerned about like-for-like emulation of the existing Also: where does this leave us wrt the 'propaganda' for DTFP with eg using |
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>
jamesmckinna
left a comment
There was a problem hiding this comment.
This all looks fine; lots of potential downstream uses/improvements, but worth landing this sooner rather than later.
|
I am in no rush but also happy to see it included. I have a deadline today but should be able to have |
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>
|
Nice cleanup operation! |
JacquesCarette
left a comment
There was a problem hiding this comment.
A few nitpicks and one issue with naming. Otherwise, this looks great.
I believe this is also now the definition that 1lab uses.
| fsuc : ∀ {n} → Fin n → Fin (suc n) | ||
| fsuc = Refinement.map suc s<s | ||
|
|
||
| data View : ∀ {n} (k : Fin n) → Set where |
There was a problem hiding this comment.
I'm not keen on View as a name here. Yes, it is a view, but... I'm partial to AsX for a decent X as names for views - but definitely not dogmatic about it. AsFin obviously is a horrible name.
There was a problem hiding this comment.
Used qualified, it gives us Fin.View and Fin.view which is not bad IMO?
| ≤″⇒≤ : _≤″_ ⇒ _≤_ | ||
| ≤″⇒≤ (k , refl) = m≤m+n _ k | ||
|
|
||
| <″⇒< : _<″_ ⇒ _<_ |
There was a problem hiding this comment.
Might be wise to separate the "straight improvements" to stdlib from the addition of the new functionality in to a separate PR.
There was a problem hiding this comment.
This is used in this PR rather than being an orthogonal improvement which makes breaking it off
in a separate PR kind of annoying.
|
Maybe |
This version has a better runtime representation
This version lets us have efficient implementations of things like
splitAtandquotRemI have been using this definition in my https://github.com/gallais/agda-tiling DSL and
it makes the library a lot faster.
I almost have feature parity with
Data.Fin.Base(I have not implemented e.g.punchOut).