packages feed

git-fmt 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+6/−3 lines, 2 files

Files

git-fmt.cabal view
@@ -1,5 +1,5 @@ name:           git-fmt-version:        0.1.0.0+version:        0.1.0.1  author:         Henry J. Wylde maintainer:     public@hjwylde.com
src/Git/Fmt/Language/Json/Pretty.hs view
@@ -14,7 +14,8 @@  module Git.Fmt.Language.Json.Pretty where -import Data.List.Extra (lower)+import Data.List.Extra  (lower)+import Data.Ratio       (denominator, numerator)  import Text.JSON.Types import Text.PrettyPrint.HughesPJClass@@ -30,6 +31,8 @@         where             keyValueDocs    = map (\(key, value) -> char '"' <> text key <> text "\":" <+> pPrint value) keyValues             keyValues       = fromJSObject obj-    pPrint (JSRational _ rat)   = text $ show (fromRational rat :: Double)+    pPrint (JSRational _ rat)+        | denominator rat == 1  = text $ show (numerator rat)+        | otherwise             = text $ show (fromRational rat :: Double)     pPrint (JSString str)       = char '"' <> text (fromJSString str) <> char '"'