Comments (6)
The Common
module looks like this:
module Common = struct
let _absname = set Clflags.absname
let _alert = Warnings.parse_alert_option
let _alias_deps = clear transparent_modules
end
Here the _foo
variables are not named with a leading underscore to be ignored, but because they may conflict with keyword names -- there is _open
down below.
An important difference between these two use-cases is that _a
in your example is unused, while _alert
(or others) above are used. This suggests a new heuristic that is not among your list:
- check
ignored-partial-application
for all unused variables, even those that start with an underscore
(If we decide to go for this, we should probably extend the logic in #12094 as well for the case match e with _a -> ...
.)
from ocaml.
Apologies for the delay.
Should I interpret the silence as this is something folks don't want?
No, just that there is limited reviewing capacity in the team :) In general we are quite happy to have suggestions and proposals from users (especially so when such proposals come with offers to help with the implementation).
I think the suggestion by @gasche makes sense:
- check
ignored-partial-application
for all unused variables, even those that start with an underscore
This is a mostly backwards-compatible change that should also address your use-case; do you agree? I didn't look in detail, but I think it shouldn't be very hard to extend the existing logic when typechecking let
expressions to implement this check. If this works out, there is a similar logic when typing match
expressions that should be extended similarly.
If you agree, would you like to give it a try?
from ocaml.
(cc @nojb, our expert on ignoring partial applications.)
from ocaml.
Should I interpret the silence as this is something folks don't want?
from ocaml.
No, just that there is limited reviewing capacity in the team :)
Of course, no problem!
This is a mostly backwards-compatible change that should also address your use-case; do you agree?
I think it does, yes.
If you agree, would you like to give it a try?
Yes, I would love to.
I'll have a look at the implementation, try to come up with a plan this week, and post it here for feedback before I go ahead with coding (unless it is trivial).
from ocaml.
I got bitten by this today; now am looking forward to this patch :)
from ocaml.
Related Issues (20)
- Improve type error explanation for partially applied functor HOT 3
- TMC on 5.2 generates unexpected lambda for Melange HOT 8
- Atomic mutable fields for objects HOT 1
- Runtime events does not cleanup pid.events file on SIGSTOP HOT 3
- Clarify @noalloc documentation HOT 1
- [5.2] build error: dllunixbyt.so_The boot compiler cannot load DLLs: No such file or directory HOT 5
- Go to definition in VS Code HOT 4
- undefined symbol: caml_zstd_initialize when building ppx using OCaml built with --without-zstd HOT 2
- Wrong interface mli generation in for loops HOT 1
- Improve error message for optional arguments mismatches
- Error installing 5.1.1: zstd/lib/libzstd.so: undefined reference to `pthread_create@GLIBC_2.34' HOT 3
- Stamps of identifiers are not unique HOT 5
- Test `statmemprof/exception_comballoc` fails under TSan (possibly TSan-internal bug) HOT 25
- ThreadSanitizer CI failures on a PR are not shown in the Github UI HOT 4
- [TSan] ocamlrun should never be linked with `-fsanitize=thread`
- Parallel Dynlink usage under Cygwin+MinGW is unsafe
- Misplaced attributes for deprecation markers HOT 7
- Officially add a Directives module to eschew toplevel directives syntax
- [TSan] Random failure of `tests/parallel/domain_dls.ml` HOT 7
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 ocaml.