I get this confusing error message:
This 2nd argument to map has an unexpected type:
93│ |> List.map calcScore
^^^^^^^^^
This calcScore value is a:
Instruction -> Points
But map needs its 2nd argument to be:
Instruction -> Points
How can I debug this error?
Very strange. Can you share more context? Maybe a GitHub link or gist
https://gist.github.com/ni-ko-o-kin/3486d50bc5eac6d3e19f7d7da3fc8181
Compiler-Build is from 2022-01-01
woah. This is a really weird manifestation of a small typo in your code. Roc is somehow missing a type error earlier in the code and progrogating that type error wrong. So definitely a bug in type checking.
The actually error is here: https://gist.github.com/ni-ko-o-kin/3486d50bc5eac6d3e19f7d7da3fc8181#file-02-solution-part2-roc-L39
should be toOutcome : Str -> Outcome
I'll file an issue for it.
Ok, thank you!
Last updated: Jul 05 2025 at 12:14 UTC