gren-lang / gren-lang/compiler
Improve error messages for filter functions
Open
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 503
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Can we special case the error message for filter functions that have been renamed? For example:
-- NAMING ERROR ------------------------------ src/Transmutable/Html/Parser.gren
I cannot find a `Array.filter` variable:
433| Array.filter (\c -> c == '\n' || c == '\r') chars
^^^^^^^^^^^^
The `Array` module does not expose a `filter` variable. These names seem close
though:
Array.foldr
Array.first
Array.flatten
Array.foldl
Hint: Read <https://github.com/gren-lang/compiler/blob/0.5.2/hints/imports.md>
to see how `import` declarations work in Gren.
Should suggested that you probably want keepIf instead of doing a typo check.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the compiler diagnostic handling for missing module members and renamed functions; the example is in src/Transmutable/Html/Parser.gren. Run the compiler on that example and verify that a missing Array.filter reference suggests keepIf when appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100