Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7edc8a6c112fd430efa62d77c3eb8c1e1320fa5fff9e86e67cced0918b5371bf
sha512=3f41006389d724198a94bdf1282d38509a6d0a7bef9c28d501f96904f35cd6f8835c2e3b1b2269dd573a18b5fc3489731d2250717daa304e9640170e0af858ca
Description
Transformation for view patterns in OCaml. Attempts to imitate Haskell view patterns.
Added to opam-repository:
README
ppx_viewpattern
Transformation for view patterns in OCaml. Attempts to imitate Haskell view patterns.
Installation
opam install ppx_viewpatternUsage
In dune:
(preprocess (pps ppx_viewpattern))Syntax
Use [%view? pat when exp] as a pattern to apply exp to whatever the pattern is matching and match the result of the exp application against pat. Analogous to the Haskell view pattern exp -> pat.
See example/ for example usage.
Supported in:
match ... with ...cases,function ...cases,fun ... -> ...arguments,let ... in ...expression binding left-hand sides,try ... with ...cases,- nested inside the
patandexpparts of a view pattern itself.
Caveats
A view pattern disables redundant-case and partial-match warnings for the corresponding match/function.
Currently unsupported in:
let ...definition left-hand sides (at top level or in modules).
Dev Dependencies (3)
-
odoc
with-doc -
qcheck-ounit
with-test -
ounit2
with-test
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building ppx_viewpattern with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.1 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure