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>
|
|
||
| ¬T-≡ : ∀ {x} → (¬ T x) ⇔ x ≡ false | ||
| ¬T-≡ {false} = mk⇔ (const refl) (const id) | ||
| ¬T-≡ {true} = mk⇔ (contradiction _) (λ ()) |
There was a problem hiding this comment.
Lambda extends to rightmost scope so this can simplify to
| ¬T-≡ {true} = mk⇔ (contradiction _) (λ ()) | |
| ¬T-≡ {true} = mk⇔ (contradiction _) λ() |
where moreover I personally prefer λ() as a single unspaced lexeme (except it is in fact two!) for this distinguished use...
There was a problem hiding this comment.
Lambda extends to rightmost scope so this can simplify to
I hate this though.
Edit: more details; these two arguments play symmetric roles and I find it strange to break
the symmetry by using this quirk of the language (which I happen to hate).
There was a problem hiding this comment.
The scoping, or the grouping? (That you hate)
There was a problem hiding this comment.
I was persuaded that rightmost made more sense back in the 1990s by Randy, but no longer quite sure how/why. True it's annoying forEquivalence etc, but that's an artefact of using a record constructor rather than a record binding?
|
Nice cleanup operation! |
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).