Beginner questions about type classes

As I mentioned earlier, the solution generously offered by @jducoeur seems to work, but IntelliJ doesn’t seem to like several things. Are any of these things that IntelliJ should get correctly, and I should file a bug report to JetBrains?

Warning about higher-kinded type.
00

Cannot resolve symbol doReduce, and also doesn’t think the imports are used—displaying them in grey italics.
00

Type annotation required for implicit definition.

Another higher-kinder type warning.