-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fmap Gets Context Wrong in Nested Contexts #192
Comments
#188 seems related. |
Swapping the conds also solved my issue with cats using the wrong context. I can try to make a PR for this, but it would be nice to hear from the maintainers if this is the right thing to do. |
@EricVM |
@EricVM +1 to the PR |
There are two tests that break when we try to infer from So, some of the possibilities are:
I find neither of these possibilities are good enough. I tried to circumvent this by defining a macro |
Fix Issue #192 of dynamic context overriding default context
To reproduce:
The expected behavior: "okay, here" is printed, and the return is
Right 2
.The actual behavior: the
fmap
never applies the function toJust 1
, instead returning it as is.I think this happens because
fmap
determines the context isEither
, andJust 1
is notRight 1
. See this example:I thought you could fix this by swapping the order of the first two cond clauses in
context/infer
-- first, check ifv
satisfiesp/Contextual
, and if so, get the context from v. Fall back to getting*context*
. But, when I made this change, some tests started failing, and I don't have the time to figure out why.The text was updated successfully, but these errors were encountered: