packages feed

ascii-table 0.3.0.0 → 0.3.0.1

raw patch · 2 files changed

+80/−78 lines, 2 filesdep ~aesondep ~basedep ~containersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: aeson, base, containers, dlist, hashable, text, unordered-containers, vector

API changes (from Hackage documentation)

- Data.AsciiTable: SChar :: {-# UNPACK #-} ~Char -> SimpleDoc e -> SimpleDoc e
+ Data.AsciiTable: SChar :: {-# UNPACK #-} !Char -> SimpleDoc e -> SimpleDoc e
- Data.AsciiTable: SLine :: {-# UNPACK #-} ~Int -> SimpleDoc e -> SimpleDoc e
+ Data.AsciiTable: SLine :: {-# UNPACK #-} !Int -> SimpleDoc e -> SimpleDoc e
- Data.AsciiTable: SText :: {-# UNPACK #-} ~Int -> String -> SimpleDoc e -> SimpleDoc e
+ Data.AsciiTable: SText :: {-# UNPACK #-} !Int -> String -> SimpleDoc e -> SimpleDoc e
- Data.AsciiTable: displayIO :: Handle -> SimpleDoc e -> IO ()
+ Data.AsciiTable: displayIO :: () => Handle -> SimpleDoc e -> IO ()
- Data.AsciiTable: displayS :: SimpleDoc e -> ShowS
+ Data.AsciiTable: displayS :: () => SimpleDoc e -> ShowS
- Data.AsciiTable: hPutDoc :: Handle -> Doc e -> IO ()
+ Data.AsciiTable: hPutDoc :: () => Handle -> Doc e -> IO ()
- Data.AsciiTable: pretty :: a -> Doc e
+ Data.AsciiTable: pretty :: Pretty a => a -> Doc e
- Data.AsciiTable: prettyList :: [a] -> Doc e
+ Data.AsciiTable: prettyList :: Pretty a => [a] -> Doc e
- Data.AsciiTable: putDoc :: Doc e -> IO ()
+ Data.AsciiTable: putDoc :: () => Doc e -> IO ()
- Data.AsciiTable: renderCompact :: Doc e -> SimpleDoc e
+ Data.AsciiTable: renderCompact :: () => Doc e -> SimpleDoc e
- Data.AsciiTable: renderPretty :: Float -> Int -> Doc e -> SimpleDoc e
+ Data.AsciiTable: renderPretty :: () => Float -> Int -> Doc e -> SimpleDoc e
- Data.AsciiTable: renderSmart :: Int -> Doc e -> SimpleDoc e
+ Data.AsciiTable: renderSmart :: () => Int -> Doc e -> SimpleDoc e

Files

ascii-table.cabal view
@@ -1,40 +1,42 @@--- This file has been generated from package.yaml by hpack version 0.14.0.------ see: https://github.com/sol/hpack--name:           ascii-table-version:        0.3.0.0-synopsis:       ASCII table-description:    ASCII table-category:       Data-homepage:       https://github.com/Sentenai/ascii-table#readme-bug-reports:    https://github.com/Sentenai/ascii-table/issues-author:         Sentenai-maintainer:     mitchellwrosen@gmail.com-copyright:      2016 Sentenai, Inc.-license:        BSD3-license-file:   LICENSE-build-type:     Simple-cabal-version:  >= 1.10+name: ascii-table+version: 0.3.0.1+synopsis: ASCII table+description: Draw an ASCII table+category: Data+homepage: https://github.com/Sentenai/ascii-table#readme+bug-reports: https://github.com/Sentenai/ascii-table/issues+author: Sentenai+maintainer: mitchellwrosen@gmail.com+copyright: 2016 Sentenai, Inc.+license: BSD3+license-file: LICENSE+build-type: Simple+cabal-version: >= 1.10+tested-with: GHC==7.4.1, GHC==7.4.2,+             GHC==7.6.1, GHC==7.6.2, GHC==7.6.3,+             GHC==7.8.1, GHC==7.8.2, GHC==7.8.3, GHC==7.8.4,+             GHC==7.10.1, GHC==7.10.2, GHC==7.10.3,+             GHC==8.0.1, GHC==8.0.2,+             GHC==8.2.1, GHC==8.2.2,+             GHC==8.4.1  source-repository head   type: git   location: https://github.com/Sentenai/ascii-table  library-  hs-source-dirs:-      src+  hs-source-dirs: src   ghc-options: -Wall   build-depends:-      aeson-    , base                 >= 4.6 && < 5-    , containers-    , dlist-    , hashable-    , text-    , unordered-containers-    , vector-    , wl-pprint-extras     >= 1.3 && < 3.6+      aeson < 1.3+    , base >= 4.5 && < 5+    , containers < 0.6+    , dlist < 0.9+    , hashable < 1.3+    , text < 1.3+    , unordered-containers < 0.3+    , vector < 0.13+    , wl-pprint-extras >= 1.3 && < 3.6   exposed-modules:       Data.AsciiTable   default-language: Haskell2010
src/Data/AsciiTable.hs view
@@ -1,9 +1,8 @@-{-# LANGUAGE BangPatterns           #-}-{-# LANGUAGE LambdaCase             #-}-{-# LANGUAGE OverloadedStrings      #-}-{-# LANGUAGE RecordWildCards        #-}-{-# LANGUAGE ScopedTypeVariables    #-}-{-# LANGUAGE ViewPatterns           #-}+{-# LANGUAGE BangPatterns        #-}+{-# LANGUAGE OverloadedStrings   #-}+{-# LANGUAGE RecordWildCards     #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ViewPatterns        #-}  -- | --@@ -55,22 +54,22 @@   , displayIO   ) where -import Control.Applicative   (pure)-import Data.Aeson            (Object, Value(..))-import Data.Char             (isPrint)-import Data.Foldable         (foldl', foldMap)-import Data.Hashable         (Hashable)-import Data.HashMap.Strict   (HashMap)-import Data.List             (transpose)-import Data.Maybe            (fromMaybe)-import Data.Monoid           ((<>), mempty)-import Data.Set              (Set)-import Data.Text             (Text, pack, unpack)+import Control.Applicative (pure)+import Data.Aeson (Object, Value(..))+import Data.Char (isPrint)+import Data.Foldable (foldl', foldMap)+import Data.Hashable (Hashable)+import Data.HashMap.Strict (HashMap)+import Data.List (transpose)+import Data.Maybe (fromMaybe)+import Data.Monoid ((<>), mempty)+import Data.Set (Set)+import Data.Text (Text, pack, unpack) import Text.PrettyPrint.Free hiding ((<>), text) -import qualified Data.HashMap.Strict            as HashMap-import qualified Data.Set                       as Set-import qualified Data.Vector                    as Vector+import qualified Data.HashMap.Strict as HashMap+import qualified Data.Set as Set+import qualified Data.Vector as Vector import qualified Text.PrettyPrint.Free.Internal as PrettyPrint  {-@@ -369,35 +368,36 @@ prettyValue = unpack . prettyValue'  where   prettyValue' :: Value -> Text-  prettyValue' = \case-    Object o ->-      "{"-      <> Vector.ifoldr'-        (\i (k,v) acc ->-          "\""-          <> k-          <> "\":"-          <> prettyValue' v-          <> if i == HashMap.size o - 1-              then acc-              else ", " <> acc)-        mempty-        (Vector.fromList (HashMap.toList o))-      <> "}"-    Array a ->-      "["-      <> Vector.ifoldr'-        (\i v acc ->-          if i == Vector.length a - 1-            then prettyValue' v <> acc-            else prettyValue' v <> ", " <> acc)-        mempty-        a-      <> "]"-    String s -> "\"" <> s <> "\""-    Number n -> pack (show n)-    Bool b   -> pack (show b)-    Null     -> "null"+  prettyValue' value =+    case value of+      Object o ->+        "{"+        <> Vector.ifoldr'+          (\i (k,v) acc ->+            "\""+            <> k+            <> "\":"+            <> prettyValue' v+            <> if i == HashMap.size o - 1+                then acc+                else ", " <> acc)+          mempty+          (Vector.fromList (HashMap.toList o))+        <> "}"+      Array a ->+        "["+        <> Vector.ifoldr'+          (\i v acc ->+            if i == Vector.length a - 1+              then prettyValue' v <> acc+              else prettyValue' v <> ", " <> acc)+          mempty+          a+        <> "]"+      String s -> "\"" <> s <> "\""+      Number n -> pack (show n)+      Bool b   -> pack (show b)+      Null     -> "null"  -- | Flatten an 'Object' so that it contains no top-level 'Object' values. flattenObject :: Object -> Object