postgresql-libpq icon indicating copy to clipboard operation
postgresql-libpq copied to clipboard

Can't compile when __GLASGOW_HASKELL__ < 700

Open osa1 opened this issue 5 years ago • 0 comments

In doubt this code compiles with GHC 7.0 even after fixing this, but still, in this code:

#if __GLASGOW_HASKELL__ >= 700
import Control.Exception (mask_)
#else
import qualified Control.Exception
mask_ = Control.Exception.block
#endif

import Control.Exception (try, IOException)

For GHC < 7.0 this defines a top-level value and then imports another module, which is not allowed. Value definitions should come after all imports.

As a fix I'd suggest dropping support for GHC 7.0 as it's probably not used these days (it was released in 2010).

osa1 avatar Aug 14 '18 09:08 osa1