rescript-lang / rescript-lang/rescript
Clean up/optimize @return(undefined_to_opt) etc.
Open
Nobody has claimed this yet.
cleanup
- Dominant language
- OCaml
- Stars
- 7.5k
- Forks
- 485
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 55
Description
We currently have the following special directives for external function definitions:
@return(nullable)
external someFunc1: unit => option<string> = "someFunc"
@return(null_undefined_to_opt)
external someFunc2: unit => option<string> = "someFunc"
@return(undefined_to_opt)
external someFunc3: unit => option<string> = "someFunc"
@return(null_to_opt)
external someFunc4: unit => option<string> = "someFunc"
- 1 and 2 are actually the same.
- For 2, 3, and 4, the naming is unidiomatic (no camelCase, ...).
- 3 is probably not needed anymore as one could just define the external to return an option?
- Only 1 is actually documented.
Contributor guide
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 locating the compiler entry points that handle @return(nullable), @return(null_undefined_to_opt), @return(undefined_to_opt), and @return(null_to_opt), then find the documentation for these directives. Resolve which directives and naming should remain, update the implementation and documentation consistently, and add or adjust coverage for the retained behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100