packages feed

dsv 1.0.0.0 → 1.0.0.1

raw patch · 8 files changed

+98/−70 lines, 8 filesdep −doctestdep ~bytestringdep ~template-haskellPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: doctest

Dependency ranges changed: bytestring, template-haskell

API changes (from Hackage documentation)

- DSV: [FoldM] :: forall (m :: Type -> Type) a b x. () => (x -> a -> m x) -> m x -> (x -> m b) -> FoldM m a b
- DSV: [Fold] :: forall a b x. () => (x -> a -> x) -> x -> (x -> b) -> Fold a b
+ DSV: Fold :: (x -> a -> x) -> x -> (x -> b) -> Fold a b
+ DSV: FoldM :: (x -> a -> m x) -> m x -> (x -> m b) -> FoldM (m :: Type -> Type) a b
- DSV: (<<<) :: Category cat => cat b c -> cat a b -> cat a c
+ DSV: (<<<) :: forall k cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- DSV: (>>>) :: Category cat => cat a b -> cat b c -> cat a c
+ DSV: (>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
- DSV: await :: Functor m => Consumer' a m a
+ DSV: await :: forall (m :: Type -> Type) a. Functor m => Consumer' a m a
- DSV: yield :: Functor m => a -> Producer' a m ()
+ DSV: yield :: forall (m :: Type -> Type) a x' x. Functor m => a -> Proxy x' x () a m ()

Files

changelog.md view
@@ -3,3 +3,13 @@ ## v1.0.0.0 - October 20, 2020  Initial version++## v1.0.0.1 - March 9, 2021++Support for GHC 9.0, although the test suite doesn't run yet;+waiting for other dependencies to support GHC 9.0 as well.++Support `bytestring-0.11`++Remove the `doctest` test suite; moved everything into the+`hedgehog` suite.
dsv.cabal view
@@ -1,14 +1,14 @@ cabal-version: 2.4  name: dsv-version: 1.0.0.0+version: 1.0.0.1 category: Text, CSV, Pipes synopsis: DSV (delimiter-separated values)  description:     Utilities for working with DSV (delimiter-separated values) files. -tested-with: GHC==8.6.5, GHC==8.8.4, GHC==8.10.2+tested-with: GHC==8.6.5, GHC==8.8.4, GHC==8.10.2, GHC==9.0.1  extra-source-files: changelog.md data-files:@@ -22,7 +22,7 @@   , test-data/doc-example-with-utf8-errors.csv   , test-data/empty.csv -copyright: 2019-2020 Typeclass Consulting, LLC+copyright: 2019-2021 Mission Valley Software LLC license: MIT license-file: license.txt @@ -96,14 +96,14 @@     build-depends:         attoparsec ^>= 0.13       , base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15-      , bytestring ^>= 0.10+      , bytestring ^>= 0.10 || ^>= 0.11       , cassava ^>= 0.5       , containers ^>= 0.6       , foldl ^>= 1.4.5       , pipes ^>= 4.3.10       , pipes-bytestring ^>= 2.1       , pipes-safe ^>= 2.3-      , template-haskell ^>= 2.14 || ^>= 2.15 || ^>= 2.16+      , template-haskell ^>= 2.14 || ^>= 2.15 || ^>= 2.16 || ^>= 2.17       , text ^>= 1.2       , validation ^>= 1.1       , vector ^>= 0.12@@ -126,28 +126,17 @@     , DSV.Tests.FileFoldCsv     , DSV.Tests.FileStrictCsvRead     , DSV.Tests.FileStrictCsvZipView+    , DSV.Tests.Header+    , DSV.Tests.NumberViews    build-depends:       dsv     , base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15-    , bytestring ^>= 0.10+    , bytestring ^>= 0.10 || ^>= 0.11     , containers ^>= 0.6     , foldl ^>= 1.4     , hedgehog ^>= 1.0+    , pipes ^>= 4.3.10     , safe-exceptions ^>= 0.1     , text ^>= 1.2     , vector ^>= 0.12--test-suite doctest-  type: exitcode-stdio-1.0-  default-language: Haskell2010-  hs-source-dirs: test-  main-is: doctest.hs--  ghc-options:-      -Wall-      -threaded--  build-depends:-      base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15-    , doctest ^>= 0.16 || ^>= 0.17
library/DSV/Header.hs view
@@ -14,56 +14,16 @@ -- pipes import qualified Pipes.Prelude as P -{- |--=== Example-->>> :set -XOverloadedLists->>> zipHeader [["A","B"],["1","2"],["3","4"]]-[[("A","1"),("B","2")],[("A","3"),("B","4")]]---}- zipHeader :: forall a . [Vector a] -> [Vector (a, a)] zipHeader [] = [] zipHeader (names : rows) = zipHeader' names rows -{- |--=== Example-->>> :set -XOverloadedLists->>> zipHeader' ["A","B"] [["1","2"],["3","4"]]-[[("A","1"),("B","2")],[("A","3"),("B","4")]]---}- zipHeader' :: forall a b . Vector a -> [Vector b] -> [Vector (a, b)] zipHeader' names rows = map (vectorZip names) rows -{- |--=== Example-->>> :set -XOverloadedLists->>> zipHeaderWith (<>) [["A","B"],["1","2"],["3","4"]]-[["A1","B2"],["A3","B4"]]---}- zipHeaderWith :: forall a b . (a -> a -> b) -> [Vector a] -> [Vector b] zipHeaderWith _ [] = [] zipHeaderWith f (names : rows) = zipHeaderWith' f names rows--{- |--=== Example-->>> :set -XOverloadedLists->>> zipHeaderWith' (<>) ["A","B"] [["1","2"],["3","4"]]-[["A1","B2"],["A3","B4"]]---}  zipHeaderWith' :: forall a b c . (a -> b -> c)     -> Vector a -> [Vector b] -> [Vector c]
license.txt view
@@ -1,4 +1,4 @@-Copyright 2019-2020 Typeclass Consulting, LLC+Copyright 2019-2021 Mission Valley Software LLC  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in
+ test/DSV/Tests/Header.hs view
@@ -0,0 +1,36 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE OverloadedLists #-}+{-# LANGUAGE OverloadedStrings #-}++module DSV.Tests.Header where++import DSV.TestPrelude++import qualified Pipes.Prelude as P++group :: Group+group = $$(discover)++-- Corresponds to the example in the documentation for 'zipHeader'.+prop_zipHeaderPipe_doc = example $+  do+    let r1 = listToVector ["A","B"] :: Vector String+    let r2 = listToVector ["1","2"]+    let r3 = listToVector ["3","4"]+    let p = do { yield r1; yield r2; yield r3 }+    result <- P.toListM (p >-> zipHeaderPipe)+    result ===+        [ [("A","1"),("B","2")]+        , [("A","3"),("B","4")]+        ]++-- Corresponds to the example in the documentation for 'zipHeaderWithPipe'.+prop_zipHeaderWithPipe_doc = example $+  do+    let r1 = listToVector ["A","B"] :: Vector String+    let r2 = listToVector ["1","2"]+    let r3 = listToVector ["3","4"]+    let p = do { yield r1; yield r2; yield r3 }+    result <- P.toListM (p >-> zipHeaderWithPipe (<>))+    result === [ ["A1","B2"], ["A3","B4"] ]
+ test/DSV/Tests/NumberViews.hs view
@@ -0,0 +1,38 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE OverloadedStrings #-}++module DSV.Tests.NumberViews where++import DSV.TestPrelude++import Data.Ratio++group :: Group+group = $$(discover)++-- Corresponds to the examples in the documentation for 'byteStringRationalView'.+prop_byteStringRationalView_doc = example $+  do+    applyView byteStringRationalView "1234" === Success (1234 % 1)+    applyView byteStringRationalView "1234.567" === Success (1234567 % 1000)+    applyView byteStringRationalView "12.3.4" === Failure InvalidRational++-- Corresponds to the examples in the documentation for 'textRationalView'.+prop_textRationalView_doc = example $+  do+    applyView textRationalView "1234" === Success (1234 % 1)+    applyView textRationalView "1234.567" === Success (1234567 % 1000)+    applyView textRationalView "12.3.4" === Failure InvalidRational++-- Corresponds to the examples in the documentation for 'byteStringDollarsView'.+prop_byteStringDollarsView_doc = example $+  do+    applyView byteStringDollarsView "$1234.567" === Success (1234567 % 1000)+    applyView byteStringDollarsView "1234.567" === Failure InvalidDollars++-- Corresponds to the examples in the documentation for 'textDollarsView'.+prop_textDollarsView_doc = example $+  do+    applyView textDollarsView "$1234.567" === Success (1234567 % 1000)+    applyView textDollarsView "1234.567" === Failure InvalidDollars
− test/doctest.hs
@@ -1,9 +0,0 @@-import Test.DocTest--main :: IO ()-main =-  doctest-    [ "-ilibrary"-    , "library/DSV/Header.hs"-    , "library/DSV/NumberViews.hs"-    ]
test/hedgehog.hs view
@@ -9,6 +9,8 @@ import qualified DSV.Tests.FileFoldCsv import qualified DSV.Tests.FileStrictCsvRead import qualified DSV.Tests.FileStrictCsvZipView+import qualified DSV.Tests.Header+import qualified DSV.Tests.NumberViews  import Control.Monad (when) @@ -25,6 +27,8 @@             [ DSV.Tests.FileFoldCsv.group             , DSV.Tests.FileStrictCsvRead.group             , DSV.Tests.FileStrictCsvZipView.group+            , DSV.Tests.Header.group+            , DSV.Tests.NumberViews.group             ]       })