sim642 / sim642/ppx_viewpattern
Pattern guards
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 13
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
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.
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.
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