-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request