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.
Cannot resolve symbol doReduce
, and also doesn’t think the imports are used—displaying them in grey italics.
Type annotation required for implicit definition.
Another higher-kinder type warning.