HACKING: fix newlines in hsimport.hs

This commit is contained in:
Julian Ospald 2016-04-17 01:41:36 +02:00
parent a98bdf972d
commit 260e7ea01c
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -16,9 +16,9 @@ main = hsimport $ defaultConfig { prettyPrint = prettyPrint
specprint :: Maybe (Bool, [HS.ImportSpec]) -> String
specprint Nothing = ""
specprint (Just (False, xs))
= "\n (\n" ++ printImportSpecs xs ++ "\n )"
= "\n (\n" ++ printImportSpecs xs ++ " )"
specprint (Just (True, xs))
= "\n hiding (\n" ++ printImportSpecs xs ++ "\n )"
= "\n hiding (\n" ++ printImportSpecs xs ++ " )"
printImportSpecs :: [HS.ImportSpec] -> String
printImportSpecs ins
@ -26,7 +26,7 @@ main = hsimport $ defaultConfig { prettyPrint = prettyPrint
in " " ++ printSpec x ++ "\n" ++ go xs
where
go [] = ""
go [x'] = " , " ++ printSpec x'
go [x'] = " , " ++ printSpec x' ++ "\n"
go (x':xs') = " , " ++ printSpec x' ++ "\n" ++ go xs'
printSpec :: HS.ImportSpec -> String
printSpec = HS.prettyPrint