Nested arrow do notation doesn't cause errors in GHCi
Summary
See the gist of the issue here.
The offending line is considered an empty do block in the arrow command. This happens due to indentation: the do block is at the same level of indentation as the enclosing do block.
This is incorrect syntax which doesn't lead to complaints when loading this module with GHCi; but it does when building the module.
Steps to reproduce
- Create a module similar to the one in the gist
- Load the module in GHCi (in my case,
stack ghci
) - Build the module (
stack build
)
Expected behavior
The compilation errors listed in https://gist.github.com/asheshambasta/64496f5f2c55f9b78293ff2eba72f884#file-errors-txt must also be emitted when loading the module with ghci.
Environment
- GHC version used: 8.4.4
Optional:
- Operating System: NixOS
- System Architecture:
Linux quasar-nixos-tp 5.1.21 #1-NixOS SMP Sun Jul 28 06:28:39 UTC 2019 x86_64 GNU/Linux