diff --git a/src/Language/Haskell/Stylish/Step/Imports.hs b/src/Language/Haskell/Stylish/Step/Imports.hs
--- a/src/Language/Haskell/Stylish/Step/Imports.hs
+++ b/src/Language/Haskell/Stylish/Step/Imports.hs
@@ -108,9 +108,8 @@
 
 
 --------------------------------------------------------------------------------
-prettyImport :: Int -> Bool -> Bool -> Int -> H.ImportDecl l -> String
+prettyImport :: Int -> Bool -> Bool -> Int -> H.ImportDecl l -> [String]
 prettyImport columns padQualified padName longest imp =
-    intercalate "\n" $
     wrap columns base (length base + 2) $
     (if hiding then ("hiding" :) else id) $
     withInit (++ ",") $
@@ -122,6 +121,7 @@
     base = unwords $ concat
          [ ["import"]
          , qualified
+         , (fmap show $ maybeToList $ H.importPkg imp)
          , [(if hasExtras && padName then padRight longest else id)
             (importName imp)]
          , ["as " ++ as | H.ModuleName _ as <- maybeToList $ H.importAs imp]
@@ -142,7 +142,7 @@
 --------------------------------------------------------------------------------
 prettyImportGroup :: Int -> Align -> Int -> [H.ImportDecl LineBlock] -> Lines
 prettyImportGroup columns align longest imps =
-    map (prettyImport columns padQual padName longest') $
+    concatMap (prettyImport columns padQual padName longest') $
     sortBy compareImports imps
   where
     longest' = case align of
diff --git a/stylish-haskell.cabal b/stylish-haskell.cabal
--- a/stylish-haskell.cabal
+++ b/stylish-haskell.cabal
@@ -1,5 +1,5 @@
 Name:          stylish-haskell
-Version:       0.5.0.2
+Version:       0.5.1.0
 Synopsis:      Haskell code prettifier
 Homepage:      https://github.com/jaspervdj/stylish-haskell
 License:       BSD3
@@ -45,7 +45,7 @@
   Build-depends:
     aeson            >= 0.6  && < 0.7,
     base             >= 4    && < 5,
-    bytestring       >= 0.9  && < 0.10,
+    bytestring       >= 0.9  && < 0.11,
     containers       >= 0.3  && < 0.6,
     directory        >= 1.1  && < 1.3,
     filepath         >= 1.1  && < 1.4,
@@ -66,7 +66,7 @@
     -- Copied from regular dependencies...
     aeson            >= 0.6  && < 0.7,
     base             >= 4    && < 5,
-    bytestring       >= 0.9  && < 0.10,
+    bytestring       >= 0.9  && < 0.11,
     containers       >= 0.3  && < 0.6,
     directory        >= 1.1  && < 1.3,
     filepath         >= 1.1  && < 1.4,
@@ -98,7 +98,7 @@
     -- Copied from regular dependencies...
     aeson            >= 0.6  && < 0.7,
     base             >= 4    && < 5,
-    bytestring       >= 0.9  && < 0.10,
+    bytestring       >= 0.9  && < 0.11,
     cmdargs          >= 0.9  && < 0.11,
     containers       >= 0.3  && < 0.6,
     directory        >= 1.1  && < 1.3,
