packages feed

git-fmt 0.1.0.1 → 0.1.0.2

raw patch · 2 files changed

+3/−11 lines, 2 files

Files

git-fmt.cabal view
@@ -1,5 +1,5 @@ name:           git-fmt-version:        0.1.0.1+version:        0.1.0.2  author:         Henry J. Wylde maintainer:     public@hjwylde.com
src/Git/Fmt/Language/Json/Pretty.hs view
@@ -14,25 +14,17 @@  module Git.Fmt.Language.Json.Pretty where -import Data.List.Extra  (lower)-import Data.Ratio       (denominator, numerator)--import Text.JSON.Types+import Text.JSON import Text.PrettyPrint.HughesPJClass   instance Pretty JSValue where     pPrint (JSArray values)     = cat [char '[', nest 1 (sep $ punctuate (char ',') (map pPrint values)), char ']']-    pPrint (JSBool bool)        = text $ lower (show bool)-    pPrint (JSNull)             = text "null"     pPrint (JSObject obj)         | null keyValues    = text "{}"         | otherwise         = char '{' $+$ nest 1 (vcat $ punctuate (char ',') keyValueDocs) $+$ char '}'         where             keyValueDocs    = map (\(key, value) -> char '"' <> text key <> text "\":" <+> pPrint value) keyValues             keyValues       = fromJSObject obj-    pPrint (JSRational _ rat)-        | denominator rat == 1  = text $ show (numerator rat)-        | otherwise             = text $ show (fromRational rat :: Double)-    pPrint (JSString str)       = char '"' <> text (fromJSString str) <> char '"'+    pPrint value            = text $ showJSValue value ""