The definition of the mainWith function is indented to column 10:
where mainWith func = do ^
The contents of the do block running on this line only recede from column 8:
args <- getArgs case args of ... ^
If you increase the indentation of the contents of the do block, which should also be indented, at least to column 10, the code is parsed correctly. With the current indentation, lines that should belong to the do block are treated as part of the where clause, but not the mainWith function.
source share