Safe import of modules from liquid-base fails

Viewed 52

I've updated dependencies for a library. Instead of using Prelude from base (https://hackage.haskell.org/package/base-4.14.1.0/docs/Prelude.html) I now use Prelude from liquid-base (https://hackage.haskell.org/package/liquid-base-4.14.1.0/docs/Prelude.html). On these Hackage pages I can see that the old module had Trustworthy status wrt Safe Haskell while the new one has None. The change caused Safe Haskell errors like this one:

.../eccrypto/src/Crypto/Fi.hs:40:1: error:
    Prelude: Can't be safely imported! The module itself isn't safe.
   |
40 | import safe Prelude as P 
   | ^^^^^^^^^^^^^^^^^^^^^^^^
  1. Why does the module has status None? Is it a bug in safety inference? The definition of the module is basically just imports of other, Safe or Trustworthy, modules.

  2. What's the best way to fix the compile error? Adding this to my cabal file didn't help:

ghc-options: -trust liquid-base
  1. How much do I lose when I use import instead of safe import? This fixes the issue.
0 Answers
Related