hindent 2.0 → 2.1
raw patch · 2 files changed
+37/−114 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- HIndent.Pretty: instance Pretty Activation
- HIndent.Pretty: instance Pretty Annotation
- HIndent.Pretty: instance Pretty Assoc
- HIndent.Pretty: instance Pretty CName
- HIndent.Pretty: instance Pretty CallConv
- HIndent.Pretty: instance Pretty ExportSpec
- HIndent.Pretty: instance Pretty GadtDecl
- HIndent.Pretty: instance Pretty IPName
- HIndent.Pretty: instance Pretty IfAlt
- HIndent.Pretty: instance Pretty ImportDecl
- HIndent.Pretty: instance Pretty ImportSpec
- HIndent.Pretty: instance Pretty ModulePragma
- HIndent.Pretty: instance Pretty Op
- HIndent.Pretty: instance Pretty PXAttr
- HIndent.Pretty: instance Pretty RPat
- HIndent.Pretty: instance Pretty RPatOp
- HIndent.Pretty: instance Pretty Rule
- HIndent.Pretty: instance Pretty RuleVar
- HIndent.Pretty: instance Pretty Safety
- HIndent.Pretty: instance Pretty WarningText
- HIndent.Pretty: instance Pretty XAttr
- HIndent.Pretty: instance Pretty XName
Files
- hindent.cabal +1/−1
- src/HIndent/Pretty.hs +36/−113
hindent.cabal view
@@ -1,5 +1,5 @@ name: hindent-version: 2.0+version: 2.1 synopsis: Extensible Haskell pretty printer description: Extensible Haskell pretty printer. Both a library and an executable. .
src/HIndent/Pretty.hs view
@@ -147,8 +147,7 @@ inter sep ps = foldr (\(i,p) next -> depend (do p- if i <- length ps+ if i < length ps then sep else return ()) next)@@ -167,7 +166,9 @@ [] -> return () (p:ps) -> do p- indented (fromIntegral (T.length pref * (-1)))+ indented (fromIntegral+ (T.length pref *+ (-1))) (mapM_ (\p' -> do newline depend (write (T.fromText pref)) p')@@ -801,18 +802,6 @@ BDecls _ ds -> lined (map pretty ds) IPBinds _ i -> lined (map pretty i) -instance Pretty Bracket where- prettyInternal x =- case x of- ExpBracket _ _ ->- error "FIXME: No implementation for ExpBracket."- PatBracket _ _ ->- error "FIXME: No implementation for PatBracket."- TypeBracket _ _ ->- error "FIXME: No implementation for TypeBracket."- DeclBracket _ _ ->- error "FIXME: No implementation for DeclBracket."- instance Pretty ClassDecl where prettyInternal x = case x of@@ -874,12 +863,6 @@ FieldPun _ n -> pretty n FieldWildcard _ -> write ".." -instance Pretty GadtDecl where- prettyInternal x =- case x of- GadtDecl _ _ _ ->- error "FIXME: No implementation for GadtDecl."- instance Pretty GuardedAlts where prettyInternal x = case x of@@ -922,18 +905,6 @@ swing (write " = ") (pretty e) -instance Pretty IPBind where- prettyInternal x =- case x of- IPBind _ _ _ ->- error "FIXME: No implementation for IPBind."--instance Pretty IfAlt where- prettyInternal x =- case x of- IfAlt _ _ _ ->- error "FIXME: No implementation for IfAlt."- instance Pretty InstDecl where prettyInternal i = case i of@@ -964,16 +935,6 @@ InfixMatch{} -> error "FIXME: No implementation for InfixMatch." -instance Pretty Module where- prettyInternal x =- case x of- Module _ _ _ _ _ ->- error "FIXME: No implementation for Module."- XmlPage{} ->- error "FIXME: No implementation for XmlPage."- XmlHybrid{} ->- error "FIXME: No implementation for XmlHybrid."- instance Pretty PatField where prettyInternal x = case x of@@ -1009,37 +970,16 @@ pretty p) gas)) -instance Pretty Rule where- prettyInternal x =- case x of- Rule _ _ _ _ _ _ ->- error "FIXME: No implementation for Rule."--instance Pretty RuleVar where- prettyInternal x =- case x of- RuleVar _ _ ->- error "FIXME: No implementation for RuleVar."- TypedRuleVar _ _ _ ->- error "FIXME: No implementation for TypedRuleVar."- instance Pretty Splice where prettyInternal x = case x of- IdSplice _ _ ->- error "FIXME: No implementation for IdSplice."+ IdSplice _ str ->+ do write "$"+ string str ParenSplice _ e -> depend (write "$") (parens (pretty e)) -instance Pretty WarningText where- prettyInternal x =- case x of- DeprText _ _ ->- error "FIXME: No implementation for DeprText."- WarnText _ _ ->- error "FIXME: No implementation for WarnText."- instance Pretty InstHead where prettyInternal x = case x of@@ -1075,77 +1015,60 @@ Cons _ -> write ":" UnboxedSingleCon _ -> write "(##)" -instance Pretty Activation where- prettyInternal = pretty'+--------------------------------------------------------------------------------+-- * Unimplemented printers -instance Pretty Annotation where- prettyInternal = pretty'+instance Pretty Module where+ prettyInternal x =+ case x of+ Module _ _ _ _ _ ->+ error "FIXME: No implementation for Module."+ XmlPage{} ->+ error "FIXME: No implementation for XmlPage."+ XmlHybrid{} ->+ error "FIXME: No implementation for XmlHybrid." -instance Pretty Assoc where- prettyInternal = pretty'+instance Pretty Bracket where+ prettyInternal x =+ case x of+ ExpBracket _ _ ->+ error "FIXME: No implementation for ExpBracket."+ PatBracket _ _ ->+ error "FIXME: No implementation for PatBracket."+ TypeBracket _ _ ->+ error "FIXME: No implementation for TypeBracket."+ DeclBracket _ _ ->+ error "FIXME: No implementation for DeclBracket." -instance Pretty CName where- prettyInternal = pretty'+instance Pretty IPBind where+ prettyInternal x =+ case x of+ IPBind _ _ _ ->+ error "FIXME: No implementation for IPBind." -instance Pretty CallConv where- prettyInternal = pretty'+--------------------------------------------------------------------------------+-- * Fallback printers instance Pretty DataOrNew where prettyInternal = pretty' -instance Pretty ExportSpec where- prettyInternal = pretty'- instance Pretty FunDep where prettyInternal = pretty' -instance Pretty IPName where- prettyInternal = pretty'--instance Pretty ImportSpec where- prettyInternal = pretty'--instance Pretty ImportDecl where- prettyInternal = pretty'- instance Pretty Kind where prettyInternal = pretty' instance Pretty Literal where prettyInternal = pretty' -instance Pretty ModulePragma where- prettyInternal = pretty'- instance Pretty Name where prettyInternal = pretty' -instance Pretty Op where- prettyInternal = pretty'--instance Pretty PXAttr where- prettyInternal = pretty'- instance Pretty QName where prettyInternal = pretty' instance Pretty QOp where prettyInternal = pretty' -instance Pretty RPat where- prettyInternal = pretty'--instance Pretty RPatOp where- prettyInternal = pretty'--instance Pretty Safety where- prettyInternal = pretty'- instance Pretty TyVarBind where- prettyInternal = pretty'--instance Pretty XAttr where- prettyInternal = pretty'--instance Pretty XName where prettyInternal = pretty'