Skip to content

Mark template-haskell as explicitly Safe / Trustworthy.

The template-haskell modules seem to be trustworthy since 2.12.0.0 or so, but not explicitly marked as such. Package in increasing amount depend on template-haskell in simple way, e.e.g to

deriving instance Lift URI

It would be great, if template-haskell were explicitly Safe / Trustworthy. E.g. docs for GHC-8.10.1 rc1 are correctly saying that Language.Haskell.TH is "just" SafeHaskell-inferred: https://downloads.haskell.org/ghc/8.10.1-rc1/docs/html/libraries/template-haskell-2.16.0.0/Language-Haskell-TH.html

And when I compile a package with -Winferred-safe-imports I get

Network/URI/Static.hs:27:1: warning: [-Winferred-safe-imports]
    Importing Safe-Inferred module Language.Haskell.TH.Lib from explicitly Safe module
   |
27 | import Language.Haskell.TH.Lib (ExpQ)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Network/URI/Static.hs:28:1: warning: [-Winferred-safe-imports]
    Importing Safe-Inferred module Language.Haskell.TH.Quote from explicitly Safe module
   |
28 | import Language.Haskell.TH.Quote (QuasiQuoter(..))
   | 

EDIT: The patch should be trivial, as pretty is explicitly Safe, so keeping SafeHaskell invariant shouldn't be a problem.

Edited by Oleg Grenrus
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information