What I try to do is the following:
map ((\Left x -> x + 1) [1, 2]
... and I would expect it to return
[2, 3]
However, I get the following error:
<interactive>:25:14: error: parse error on input ‘)’
What am I doing wrong here?
What I try to do is the following:
map ((\Left x -> x + 1) [1, 2]
... and I would expect it to return
[2, 3]
However, I get the following error:
<interactive>:25:14: error: parse error on input ‘)’
What am I doing wrong here?
Copyright © 2021 Jogjafile Inc.
You have incorrectly organized your parentheses, and introduced Either when it's not related to any of the other code.
Write
It's not clear why you want Either to be involved, since you're mapping over a list without any Either values in it. Maybe what you want is