stylish-haskell
stylish-haskell copied to clipboard
Modules with Unsafe language pragmas can use "safe import"
If I use stylish-haskell
on a module with
{-# LANGUAGE Unsafe #-} -- "import safe" is enforced
I still get the following error:
Language.Haskell.Stylish.Parse.parseModule: could not parse src/Extract/DefinitionsTheoremsLemmas.hs: ParseFailed (SrcLoc "<unknown>.hs" 15 13) "At least one of Safe or SafeImports or Trustworthy language extensions needs to be enabled. Please add: {-# LANGUAGE Safe #-} or {-# LANGUAGE SafeImports #-} or {-# LANGUAGE Trustworthy #-} language pragma at the top of your module."
Unsafe
is described on the GHC wiki.
This depends on haskell-src-exts
supporting the pragma.
Reported upstream
An example for future reference:
{-# LANGUAGE Unsafe #-}
module Main where
import safe Safe
main :: IO ()
main = putStrLn "Hello, World!"