haskell-src-exts 1.9.3 → 1.9.4
raw patch · 2 files changed
+18/−18 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
haskell-src-exts.cabal view
@@ -1,5 +1,5 @@ Name: haskell-src-exts-Version: 1.9.3+Version: 1.9.4 License: BSD3 License-File: LICENSE Author: Niklas Broberg
src/Language/Haskell/Exts/Pretty.hs view
@@ -718,11 +718,11 @@ ---------------------------- Kinds ---------------------------- instance Pretty Kind where- pretty KindStar = text "*"- pretty KindBang = text "!"- pretty (KindFn a b) = myFsep [pretty a, text "->", pretty b]- pretty (KindParen k) = parens $ pretty k- pretty (KindVar n) = pretty n+ prettyPrec _ KindStar = text "*"+ prettyPrec _ KindBang = text "!"+ prettyPrec n (KindFn a b) = parensIf (n > 0) $ myFsep [prettyPrec 1 a, text "->", pretty b]+ prettyPrec _ (KindParen k) = parens $ pretty k+ prettyPrec _ (KindVar n) = pretty n ppOptKind :: Maybe Kind -> [Doc] ppOptKind Nothing = []@@ -763,28 +763,28 @@ instance Pretty Exp where prettyPrec _ (Lit l) = pretty l -- lambda stuff- prettyPrec p (InfixApp a op b) = parensIf (p > 0) $ myFsep [pretty a, pretty op, pretty b]- prettyPrec _ (NegApp e) = parens $ myFsep [char '-', pretty e]- prettyPrec p (App a b) = parensIf (p > 0) $ myFsep [pretty a, prettyPrec 1 b]- prettyPrec p (Lambda _loc expList ppBody) = parensIf (p > 0) $ myFsep $- char '\\' : map pretty expList ++ [text "->", pretty ppBody]+ prettyPrec p (InfixApp a op b) = parensIf (p > 2) $ myFsep [prettyPrec 2 a, pretty op, prettyPrec 1 b]+ prettyPrec p (NegApp e) = parensIf (p > 0) $ char '-' <> prettyPrec 4 e+ prettyPrec p (App a b) = parensIf (p > 3) $ myFsep [prettyPrec 3 a, prettyPrec 4 b]+ prettyPrec p (Lambda _loc patList ppBody) = parensIf (p > 1) $ myFsep $+ char '\\' : map pretty patList ++ [text "->", pretty ppBody] -- keywords -- two cases for lets prettyPrec p (Let (BDecls declList) letBody) =- parensIf (p > 0) $ ppLetExp declList letBody+ parensIf (p > 1) $ ppLetExp declList letBody prettyPrec p (Let (IPBinds bindList) letBody) =- parensIf (p > 0) $ ppLetExp bindList letBody+ parensIf (p > 1) $ ppLetExp bindList letBody - prettyPrec p (If cond thenexp elsexp) = parensIf (p > 0) $+ prettyPrec p (If cond thenexp elsexp) = parensIf (p > 1) $ myFsep [text "if", pretty cond, text "then", pretty thenexp, text "else", pretty elsexp]- prettyPrec p (Case cond altList) = parensIf (p > 0) $+ prettyPrec p (Case cond altList) = parensIf (p > 1) $ myFsep [text "case", pretty cond, text "of"] $$$ ppBody caseIndent (map pretty altList)- prettyPrec p (Do stmtList) = parensIf (p > 0) $ + prettyPrec p (Do stmtList) = parensIf (p > 1) $ text "do" $$$ ppBody doIndent (map pretty stmtList)- prettyPrec p (MDo stmtList) = parensIf (p > 0) $ + prettyPrec p (MDo stmtList) = parensIf (p > 1) $ text "mdo" $$$ ppBody doIndent (map pretty stmtList) -- Constructors & Vars prettyPrec _ (Var name) = pretty name@@ -846,7 +846,7 @@ int a, char ':', int b, char '-', int c, char ':', int d, text "#-}", pretty e] -- Arrows- prettyPrec p (Proc _ pat e) = parensIf (p > 0) $ myFsep $ [text "proc", pretty pat, text "->", pretty e]+ prettyPrec p (Proc _ pat e) = parensIf (p > 1) $ myFsep $ [text "proc", pretty pat, text "->", pretty e] prettyPrec p (LeftArrApp l r) = parensIf (p > 0) $ myFsep $ [pretty l, text "-<", pretty r] prettyPrec p (RightArrApp l r) = parensIf (p > 0) $ myFsep $ [pretty l, text ">-", pretty r] prettyPrec p (LeftArrHighApp l r) = parensIf (p > 0) $ myFsep $ [pretty l, text "-<<", pretty r]