Repository navigation
Conversation
Changelog🐛 Bug fix
Semantic Diff2 commits · Full page ✏️ Show a functor's parameters on hoverc2139f1 · cknitt + Claude · Oct 27, 2026, 12:54 UTC · edited
Diagnostic modified (hover on a functor) module type Ord = {
type t
let compare: (t, t) => int
}
module MakeSet = (O: Ord) => {
type t = array<O.t>
let add = (s: t, x: O.t) => s->Array.concat([x])
}
-module MakeSet: {
+module MakeSet: (O: Ord) => {
type t = array<O.t>
let add: (t, O.t) => array<O.t>
}Review
✏️ Show unit parameters of a multi-parameter functor on hover1ede2dc · cknitt + Claude · Oct 29, 2026, 10:06 UTC · edited Codex review on #9083: a unit parameter showed as nothing, so hover on |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix-9072-applied-functor-types #9083 +/- ##
===============================================================
Coverage 81.52% 81.53%
===============================================================
Files 460 460
Lines 64824 64848 +24
===============================================================
+ Hits 52851 52873 +22
- Misses 11973 11975 +2
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9083 |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71fcc36a3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
71fcc36 to
518b1df
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
cristianoc
left a comment
There was a problem hiding this comment.
Reviewed the hover parameter metadata, applied-signature dependency, and named/multiple/inline/applied/partial/generative fixtures. The reported structural-result case is fixed, and no blocking regression was found. Named-result Ident functors remain a pre-existing limitation. CI analysis tests inspected; tests were not rerun locally.
518b1df to
aac2e68
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aac2e68c57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
aac2e68 to
10d59e4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10d59e4e02
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review on #9083: a unit parameter showed as nothing, so hover on `(P: Primitive, ()) => ...` read `(P: Primitive, ) => ...`. It shows as `()` now, and a functor with only a unit parameter as `() => ...`, as the formatter prints them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gGkPma9LAZimuQjnrP Signed-off-by: Christoph Knittel <ck@cca.io>
10d59e4 to
4c90bc1
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
Codex review on #9083: a unit parameter showed as nothing, so hover on `(P: Primitive, ()) => ...` read `(P: Primitive, ) => ...`. It shows as `()` now, and a functor with only a unit parameter as `() => ...`, as the formatter prints them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gGkPma9LAZimuQjnrP Signed-off-by: Christoph Knittel <ck@cca.io>
4c90bc1 to
23c59f2
Compare
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
Codex review on #9083: a unit parameter showed as nothing, so hover on `(P: Primitive, ()) => ...` read `(P: Primitive, ) => ...`. It shows as `()` now, and a functor with only a unit parameter as `() => ...`, as the formatter prints them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gGkPma9LAZimuQjnrP Signed-off-by: Christoph Knittel <ck@cca.io>
23c59f2 to
72283e7
Compare
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why:
Editor analysis models a functor by the structure of its result, so
hover on a functor showed its body as if it were a plain module, and
nothing said it takes arguments. The result structure now records the
parameters, and hover prints them in front of the body.
Diagnostic modified (hover on a functor):
Example:
module type Ord = {
type t
let compare: (t, t) => int
}
module MakeSet = (O: Ord) => {
type t = array<O.t>
let add = (s: t, x: O.t) => s->Array.concat([x])
}
Before (rescript): tests/analysis_tests/tests/src/HoverFunctor.res
module MakeSet: {
type t = array<O.t>
let add: (t, O.t) => array<O.t>
}
After (rescript): tests/analysis_tests/tests/src/HoverFunctor.res
module MakeSet: (O: Ord) => {
type t = array<O.t>
let add: (t, O.t) => array<O.t>
}
Review: Why not add a functor case to the analysis module type?
Completion, references and path resolution all treat a functor as its
result and would each need the new case; only hover displays the
parameters, so they are recorded on the result structure.
Review: What does hover show for an applied functor?
A plain module: an application is modelled by its signature, so
`module IntSet = MakeSet(IntOrd)` shows no parameters, and a partial
application such as `Pair(IntOrd)` shows only the remaining one.
Fixes: #9071
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gLMawVgtmiKy3TMBc3
Claude-Session: https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo
Signed-off-by: Christoph Knittel <ck@cca.io>
Codex review on #9083: a unit parameter showed as nothing, so hover on `(P: Primitive, ()) => ...` read `(P: Primitive, ) => ...`. It shows as `()` now, and a functor with only a unit parameter as `() => ...`, as the formatter prints them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gGkPma9LAZimuQjnrP Claude-Session: https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo Signed-off-by: Christoph Knittel <ck@cca.io>
72283e7 to
1ede2dc
Compare
Fixes #9071. Stacked on #9084, which models an applied functor by its result signature.
Hover on a functor now shows its parameters, for example
module MakeSet: (O: Ord) => {...}. Analysis models a functor by its result structure; the parameters are recorded on that structure, and only hover displays them.An applied functor such as
module IntSet = MakeSet(IntOrd)is a plain module and shows no parameters; a partial application shows only the remaining ones, and a generative functor shows() =>.New analysis test:
HoverFunctor(named, multi-parameter, inline-signature, applied, partially applied and generative functors).Known limitation: a functor whose result is a module type identifier (
(O: Ord): Set => …, ormodule Make: (O: Ord) => Setin an interface) still hovers without its parameters, since that result is modelled as an identifier.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gLMawVgtmiKy3TMBc3