haskell / haskell/happy

`Fin n` for array indexes?

Open
#313 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
322
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Happy currently has a lot of "untyped" array indexing, where nothing stops one using an index for the wrong of e.g. tokens, non-terminals, terminals.

I haven't done finite sets in Haskell for a while, so not sure the state of things these days (still `KnownNat` and friends I suppose?), but I wonder if we should try using them. It would be a lot less scary to refactor the code if these indexes wouldn't be confused for one another.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the untyped array-indexing sites for tokens, non-terminals, and terminals, then evaluate whether finite or typed indexes can distinguish them. Done would require an agreed approach and implementation scope, which this issue does not specify.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.