Pattern guards
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- ocaml
- Domain
- compilers
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.
Description
Haskell has another feature called "pattern guards":
- https://wiki.haskell.org/Pattern_guard
- https://web.archive.org/web/20170109011924/http://research.microsoft.com/en-us/um/people/simonpj/Haskell/guards.html
- https://www.microsoft.com/en-us/research/publication/pattern-guards-and-transformational-patterns/
- https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.13
- https://gitlab.haskell.org/haskell/prime/-/wikis/PatternGuards
There are severely outdated ports of them to OCaml:
- For OCaml 3: https://code.google.com/archive/p/ocaml-patterns/wikis/PatternGuards.wiki and https://github.com/jaked/patterns
- For OCaml 4.02.1: https://opam.ocaml.org/packages/ppx_pattern_guard/
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.
- Dominant language
- OCaml
- Stars
- 13
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
Similar issues
-
compiler/runtime
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EricSpencer00/Resilient#4824 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
Difficulty 2/5 1-3 hours Newbie friendliness 82/100