Skip to content

refactor: use a refinement type for Data.Vec#586

Open
4e554c4c wants to merge 3 commits intothe1lab:mainfrom
4e554c4c:refinement
Open

refactor: use a refinement type for Data.Vec#586
4e554c4c wants to merge 3 commits intothe1lab:mainfrom
4e554c4c:refinement

Conversation

@4e554c4c
Copy link
Contributor

resolves: #567

Description

As per a suggestion by @TOTBWF, this changes Data.Vec to use a refinement type which codes length xs = n.

Unfortunately this means that induction on vecs now needs vec-view, which makes some things messier. Worse still, I can't seem to use [] as a pattern for the empty vec since it conflicts with list, and use at all since it can't be a pattern.

The order of instances is also changed a little bit, which means [ p ] fails to realize as a list in 1Lab.Reflection.List.

I'd love some tips on how to make this a little bit cleaner :)

Checklist

Before submitting a merge request, please check the items below:

  • I've read the contributing guidelines.
  • The imports of new modules have been sorted with support/sort-imports.hs (or nix run --experimental-features nix-command -f . sort-imports).
  • All new code blocks have "agda" as their language.

@Lavenza
Copy link
Member

Lavenza commented Jan 21, 2026

4e554c4c and others added 2 commits January 27, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Data.Vec to use a refinement type ala Fin

4 participants