mrkkrp / mrkkrp/parser-combinators

Make it possible for operators in makeExprParser to fail conditionally by analyzing their operands

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Haskell
Stars
55
Forks
17
PR merge metrics
No merged PRs in 30d

Description

I'm running in to trouble with makeExprParser. I would like to conditionally return an error if something in an operator is wrong. I am making an assign operator, and the left side can only be an identifier. I'm finding that it's impossible to do any kind of error without fully traversing my Expr. I think it would be helpful if there was a version of makeExprParser that allows operators to return Either e a, and when Left e is returned, return that error if no alternative is found.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the makeExprParser entry point and reviewing how operators are analyzed and alternatives are selected. Determine how conditional operand errors should be represented and propagated when no alternative is found. Done means the parser supports the requested conditional failure behavior without requiring callers to fully traverse Expr.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.