haskell / stylish-haskell

Haskell code prettifier
Other
987 stars 151 forks source link

stylish-haskell smashes safe imports #90

Closed konn closed 7 years ago

konn commented 9 years ago

If we apply stylish-haskell to the following code, safe import is gone...

before:

{-# LANGUAGE SafeImports #-}
module Main where
import safe Prelude

main :: IO ()
main = undefined

after:

{-# LANGUAGE SafeImports #-}
module Main where
import Prelude

main :: IO ()
main = undefined
bitemyapp commented 9 years ago

It does this to import {-# SOURCE #-} Module imports as well.

danplubell commented 8 years ago

How should the following examples format for each Align value? import qualified MyQualifiedModule QM import MySimpleModule import {-# SOURCE #-} MyModule1 import {-# SOURCE #-} qualified MyModule2 as MM import safe MyModule3 import safe qualified MyModule4 as M4 import "base" Data.Foldable (foldMap) import qualified "containers" Data.Map as Map

alexkazik commented 8 years ago

It's better to just skip them from being formatted instead of dropping the information like it's now.

neongreen commented 7 years ago

It has been fixed in #143.