Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Language/Haskell/Exts/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,18 @@ instance Pretty (ImportSpecList l) where
(if b then text "hiding" else empty)
<+> parenList (map pretty ispecs)

instance Pretty (ImportSpec l) where
instance Pretty (ImportSpec l) where
pretty (IVar _ name ) = pretty name
pretty (IAbs _ ns name) = pretty ns <+> pretty name
pretty (IThingAll _ name) = pretty name <> text "(..)"
pretty (IThingWith _ name nameList) =
pretty name <> (parenList . map pretty $ nameList)
pretty (IThingAll _ name) = let rest = pretty name <> text "(..)" in
case name of
-- if it's a symbol, append a "type" prefix to the beginning
(Symbol _ _) -> pretty (TypeNamespace {}) <+> rest
(Ident _ _) -> rest
pretty (IThingWith _ name nameList) = let rest = pretty name <> (parenList . map pretty $ nameList) in
case name of
(Symbol _ _) -> pretty (TypeNamespace {}) <+> rest
(Ident _ _) -> rest

instance Pretty (TypeEqn l) where
pretty (TypeEqn _ pat eqn) = mySep [pretty pat, equals, pretty eqn]
Expand Down