Skip to content

GHCi fails to `:reload` modules that require a plugin after turning on collection of type info with `:set +c`

Steps to reproduce

cabal init

Paste this into app/Main.hs:

{-# OPTIONS_GHC -fplugin=MonadicBang #-}

module Main where

main :: IO ()
main = do print !(return 'a')

Add monadic-bang to your *.cabal file:

    build-depends:    base ^>=4.17.0.0, monadic-bang
$ cabal repl
ghci> :set +c
ghci> :r
Ok, one module loaded.
Collecting type info for 1 module(s) ...
Error while getting type info from Main: app/Main.hs:6:17: error:
    Bang pattern in expression context: !(return 'a')
    Did you mean to add a space after the '!'?

Expected behavior

Load the module.

Environment

  • GHC version used: 9.4.4

Optional:

  • Operating System: Mac
  • System Architecture: ARM (Mac M1)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information