Comments (5)
I suppose we could translate
| (`P1 | `P2), (`P3 | `P4) -> e
to
| `P1, `P3 -> point 1; point 3; e' ()
| `P1, `P4 -> point 1; point 4; e' ()
| `P2, `P3 -> point 2; point 3; e' ()
| `P2, `P4 -> point 2; point 4; e' ()
i.e. count visits to the clauses independently instead of trying to count visits to elements of their cross product.
In any case, this kind of translation would help me to test automata in Markup.ml much more thoroughly.
from bisect_ppx.
I'm a bit confused, your original example doesn't compile; the first branch is a variant and the second a tuple. Did you mean:
match foo with
| `P1 -> e1
| (`P2 | `P3 as x) as y -> e2
from bisect_ppx.
Yes :) I changed the patterns from p1
to ``P1` at the last moment and wasn't careful updating it.
from bisect_ppx.
I think a simpler way of rewriting the original example would be:
match foo with
| `P1 -> Bisect.mark 0; e1
| (`P2 | `P3 as x) -> (match x with `P2 -> Bisect.mark 1 | `P3 -> Bisect.mark 2); e2
This has the advantage of being a simpler recursive map of the Ppat_or
pattern
from bisect_ppx.
I think the recursive map is ultimately the same, just the interpretation (what is being constructed as a result of it) is different, but this is a good idea. It doesn't change the "real" case list entered by the user, which keeps instrumented code resistant to bugs in Bisect_ppx, among other things. Thanks.
from bisect_ppx.
Related Issues (20)
- Update readme to mention usage in Dune HOT 1
- Support [@coverage off] for or-patterns
- Proposal: add <packages> to cobertura report
- Proposal: support more mandatory fields from cobertura dtd HOT 5
- Bugs in expect_test test? HOT 2
- ppxlib >= 0.28 compatibility HOT 2
- Cannot understand why certain expressions are not instrumented/reported as visited HOT 14
- Don't suppress TRMC optimization
- Consider an optional deuteranopia-friendly theme HOT 1
- The `--expect DIR` switch requires a trailing slash
- Fails to build on rescript 10: "Unbound type constructor out_channel"
- Coverage per folder HOT 2
- Branch (partial) coverage in cobertura report
- Melange compatible version HOT 3
- coverage is only being applied by running specific .exe test files HOT 8
- Question on out-edge instrumentation of if-then-else and match cases HOT 3
- warning on ignored file that does not exist ?
- spelling-error-in-binary in usr/lib/ocaml/bisect_ppx/ppx.exe
- static library name scheme issue HOT 2
- Preprocessing with bisect leads to lost of polymorphism
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bisect_ppx.