From 3d3865a4e605ca9a1ceacdcdab6c19df17de0079 Mon Sep 17 00:00:00 2001 From: Moritz Drexl Date: Tue, 13 Dec 2016 22:48:20 +0100 Subject: keep `safe` and `{-# SOURCE #-}` import annotations --- lib/Language/Haskell/Stylish/Step/Imports.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/Language/Haskell/Stylish/Step/Imports.hs b/lib/Language/Haskell/Stylish/Step/Imports.hs index 334fa15..08918ae 100644 --- a/lib/Language/Haskell/Stylish/Step/Imports.hs +++ b/lib/Language/Haskell/Stylish/Step/Imports.hs @@ -235,6 +235,8 @@ prettyImport columns Options{..} padQualified padName longest imp base' baseName importAs hasHiding' = unwords $ concat $ filter (not . null) [ ["import"] + , source + , safe , qualified , show <$> maybeToList (H.importPkg imp) , [baseName] @@ -262,6 +264,14 @@ prettyImport columns Options{..} padQualified padName longest imp | padQualified = [" "] | otherwise = [] + safe + | H.importSafe imp = ["safe"] + | otherwise = [] + + source + | H.importSrc imp = ["{-# SOURCE #-}"] + | otherwise = [] + mapSpecs f = case importSpecs of Nothing -> [] -- Import everything Just [] -> ["()"] -- Instance only imports -- cgit v1.2.3