Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lwt_react: no longer compare structurally the inputs of S.l[2-6]_s #893

Merged
merged 2 commits into from
Nov 3, 2021

Conversation

vouillon
Copy link
Member

This avoids a failure when some inputs cannot be compared (if they contain functional values, for instance).
We need to do something anyway if one of the inputs changes, so it makes sense to use physical equality here.

This avoids a failure when some inputs cannot be compared structurally
(if they contain functional values, for instance).

Internally, Lwt_react.S.l2 is implemented using React.S.l2 and
Lwt_react.S.map_s. We were not providing an equality function to
React.S.l2, so the default structural equality was used. Now, we use the
function (fun _ _ -> false). So, the function parameter is applied each
time any of the input change, which is exactly what we would expect if
we implemented Lwt_react.S.map_s directly.
@vouillon vouillon changed the title Lwt_react: use physical equality internally to implement S.l[2-6]_s Lwt_react: no longer compare structurally the inputs of S.l[2-6]_s Oct 28, 2021
@raphael-proust raphael-proust merged commit b88ed83 into master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants