packages feed

ats-format 0.1.3.0 → 0.1.3.1

raw patch · 3 files changed

+8/−6 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ats-format.cabal view
@@ -1,5 +1,5 @@ name:                ats-format-version:             0.1.3.0+version:             0.1.3.1 synopsis:            A source-code formatter for ATS description:         An opinionated source-code formatter for [ATS](http://www.ats-lang.org/). homepage:            https://hub.darcs.net/vmchale/ats-format#readme
src/Language/ATS/PrettyPrint.hs view
@@ -131,7 +131,7 @@  prettyBinary :: Doc -> [Doc] -> Doc prettyBinary op es-    | length (show $ mconcat es) < 80 = prettySmall op es+    | length (showFast $ mconcat es) < 80 = prettySmall op es     | otherwise = prettyLarge op es  prettyLarge :: Doc -> [Doc] -> Doc@@ -141,7 +141,7 @@ -- FIXME we really need a monadic pretty printer lol. lengthAlt :: Doc -> Doc -> Doc lengthAlt d1 d2-    | length (show d2) >= 40 = d1 <$> indent 4 d2+    | length (showFast d2) >= 40 = d1 <$> indent 4 d2     | otherwise = d1 <+> d2  instance Pretty Expression where@@ -365,9 +365,12 @@ lineAlt :: Doc -> Doc -> Doc lineAlt = group .* flatAlt +showFast :: Doc -> String+showFast d = displayS (renderCompact d) mempty+ prettyRecord :: (Pretty a) => [(String, a)] -> Doc prettyRecord es-    | any ((>40) . length . show . pretty) es = prettyRecordF True es+    | any ((>40) . length . showFast . pretty) es = prettyRecordF True es     | otherwise = lineAlt (prettyRecordF True es) (prettyRecordS True es)  prettyRecordS :: (Pretty a) => Bool -> [(String, a)] -> Doc
test/data/polyglot.out view
@@ -1035,8 +1035,7 @@         var viewstream = $EXTRA.streamize_fileref_word(x)         val result = stream_vt_foldleft_cloptr( viewstream                                               , init-                                              , lam (acc, next) =>-                                                  step_keyword(size, acc, next, ext)+                                              , lam (acc, next) => step_keyword(size, acc, next, ext)                                               )         val _ = fileref_close(x)       in