sim642 / sim642/ppx_viewpattern

Pattern guards

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

Nobody has claimed this yet.

enhancement
Dominant language
OCaml
Stars
13
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Haskell has another feature called "pattern guards":

There are severely outdated ports of them to OCaml:

There are also OCaml RFCs:

Although this ppx is currently explicitly for view patterns, it might be relatively easy to swallow ppx_pattern_guard functionality for transforming matches while sharing some of the underlying infrastructure. Neither feature subsumes the other, but there are big similarities, so it might be worth generalizing this ppx.

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 reading the repository's existing view-pattern PPX implementation, then compare it with ppx_pattern_guard and OCaml RFCs 12 and 35. Before coding, confirm the intended generalization and define which pattern-guard transformations should be supported; the issue is done when that scope is implemented and validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Feature
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.