Bläddra i källkod

Updates to match new dependencies

  * Add stack and LTS Haskell 5.2
  * Some updates based on hlint suggestions
  * Bump version and dependency versions
  * Rename the change log
tags/v0.2.0.0
Peter J. Jones 3 år sedan
förälder
incheckning
050572cbaa
13 ändrade filer med 70 tillägg och 44 borttagningar
  1. 4
    0
      .gitignore
  2. 0
    3
      .gitmodules
  3. 0
    8
      CHANGELOG
  4. 15
    0
      CHANGES.md
  5. 14
    18
      GNUmakefile
  6. 1
    1
      LICENSE
  7. 13
    0
      build/nixpkgs.nix
  8. 9
    0
      build/stack.yaml
  9. 10
    8
      cassava-streams.cabal
  10. 1
    1
      src/System/IO/Streams/Csv/Encode.hs
  11. 0
    1
      src/System/IO/Streams/Csv/Tutorial.hs
  12. 3
    3
      test/test.hs
  13. 0
    1
      util

+ 4
- 0
.gitignore Visa fil

@@ -2,3 +2,7 @@
2 2
 /.cabal-sandbox
3 3
 /cabal.sandbox.config
4 4
 /test/massive.csv
5
+/.stack-work
6
+/build/.stack-work
7
+/default.nix
8
+/stack.yaml

+ 0
- 3
.gitmodules Visa fil

@@ -1,3 +0,0 @@
1
-[submodule "util"]
2
-	path = util
3
-	url = git://pmade.com/haskell-util

+ 0
- 8
CHANGELOG Visa fil

@@ -1,8 +0,0 @@
1
-2014-11-11  Peter Jones  <pjones@devalot.com>
2
-
3
-	* System/IO/Streams/Csv/Decode.hs added more descriptive error messages.
4
-	* cassava-streams bumped version number (0.1.1.0).
5
-
6
-2014-04-30  Peter Jones  <pjones@devalot.com>
7
-
8
-	* cassava-streams initial release (version 0.1.0.0).

+ 15
- 0
CHANGES.md Visa fil

@@ -0,0 +1,15 @@
1
+# Change Log / Release Notes
2
+
3
+## 0.2.0.0 (February 8, 2016)
4
+
5
+  * Compile with GHC 7.10.3
6
+  * Update dependency versions
7
+  * Build with stack and LTS Haskell 5.2
8
+
9
+## 0.1.1.0 (November 11, 2014)
10
+
11
+  * `System/IO/Streams/Csv/Decode.hs` added more descriptive error messages.
12
+
13
+## 0.1.0.0 (April 30, 2014)
14
+
15
+  * cassava-streams initial release

+ 14
- 18
GNUmakefile Visa fil

@@ -1,27 +1,23 @@
1 1
 ################################################################################
2
-# From util/haskell.mk (git submodule update --init)
3
-CABAL_FLAGS = --enable-tests -fmaintainer -ftutorial
4
-include util/haskell.mk
2
+export TMPDIR = $(HOME)/tmp
5 3
 
6 4
 ################################################################################
7
-CSV_HEADER     = test/header.csv
8
-CSV_MEGA       = test/massive.csv
9
-TUTORIAL       = dist/build/tutorial/tutorial todo
10
-PROF_OPTS      = +RTS -sstderr -hc -pa -xc
5
+TMP_DUMMY     = $(TMPDIR)/.dummy
6
+STACK_OPTS    = --stack-yaml=build/stack.yaml
11 7
 
12 8
 ################################################################################
13
-clean::
14
-	rm -f $(CSV_MEGA)
15
-	rm -f $(foreach e,aux hp pdf prof ps,tutorial.$(e))
9
+.PHONY: all test clean
16 10
 
17 11
 ################################################################################
18
-profile:: $(CSV_MEGA)
19
-	$(TUTORIAL) $(PROF_OPTS) < $(CSV_MEGA) > profile.stdout
20
-	hp2ps -M -b -c tutorial.hp
21
-	ps2pdf tutorial.ps
12
+all: $(TMP_DUMMY)
13
+	stack $(STACK_OPTS) setup
14
+	stack $(STACK_OPTS) build
15
+	hlint src test
22 16
 
23 17
 ################################################################################
24
-# Generate a very large CSV file for profiling.
25
-$(CSV_MEGA): $(CSV_HEADER)
26
-	sh test/make-huge-csv.sh $@ $(CSV_HEADER)
27
-	du -h $@
18
+test:
19
+	stack $(STACK_OPTS) test
20
+
21
+################################################################################
22
+clean:
23
+	stack $(STACK_OPTS) clean

+ 1
- 1
LICENSE Visa fil

@@ -1,4 +1,4 @@
1
-Copyright (c) 2014 Peter Jones <pjones@devalot.com>
1
+Copyright (c) 2014-2016 Peter Jones <pjones@devalot.com>
2 2
 
3 3
 All rights reserved.
4 4
 

+ 13
- 0
build/nixpkgs.nix Visa fil

@@ -0,0 +1,13 @@
1
+with (import <nixpkgs> {});
2
+
3
+stdenv.mkDerivation {
4
+  name = "cassava-streams";
5
+
6
+  buildInputs = [
7
+    # GHC:
8
+    haskell.packages.lts-4_2.ghc
9
+
10
+    # Non-Haskell Dependencies:
11
+    zlib
12
+  ];
13
+}

+ 9
- 0
build/stack.yaml Visa fil

@@ -0,0 +1,9 @@
1
+resolver: lts-5.2
2
+
3
+packages:
4
+  - ../
5
+
6
+flags:
7
+  cassava-streams:
8
+    maintainer: true
9
+    tutorial: true

+ 10
- 8
cassava-streams.cabal Visa fil

@@ -1,16 +1,16 @@
1 1
 --------------------------------------------------------------------------------
2 2
 name:          cassava-streams
3
-version:       0.1.1.0
3
+version:       0.2.0.0
4 4
 synopsis:      io-streams interface for the cassava CSV library.
5 5
 license:       BSD3
6 6
 license-file:  LICENSE
7 7
 author:        Peter Jones <pjones@devalot.com>
8 8
 maintainer:    Peter Jones <pjones@devalot.com>
9
-copyright:     Copyright (c) 2014 Peter Jones
9
+copyright:     Copyright (c) 2014-2016 Peter Jones
10 10
 category:      Data, Text, CSV, IO-Streams
11 11
 build-type:    Simple
12
-cabal-version: >=1.10
13
-tested-with:   GHC==7.8.2, GHC==7.8.3
12
+cabal-version: >=1.18
13
+tested-with:   GHC==7.10.3
14 14
 homepage:      https://github.com/pjones/cassava-streams
15 15
 bug-reports:   https://github.com/pjones/cassava-streams/issues
16 16
 description:
@@ -22,8 +22,10 @@ description:
22 22
 --------------------------------------------------------------------------------
23 23
 extra-source-files:
24 24
   README.md
25
-  CHANGELOG
26
-  test/simple.csv
25
+  CHANGES.md
26
+  test/*.csv
27
+  build/*.yaml
28
+  build/*.nix
27 29
 
28 30
 --------------------------------------------------------------------------------
29 31
 source-repository head
@@ -61,8 +63,8 @@ library
61 63
   build-depends: base       >= 4.6   && < 5.0
62 64
                , bytestring >= 0.10  && < 0.11
63 65
                , cassava    >= 0.4   && < 0.5
64
-               , io-streams >= 1.1   && < 1.2
65
-               , vector     >= 0.10  && < 0.11
66
+               , io-streams >= 1.1   && < 1.4
67
+               , vector     >= 0.10  && < 0.12
66 68
 
67 69
 --------------------------------------------------------------------------------
68 70
 executable tutorial

+ 1
- 1
src/System/IO/Streams/Csv/Encode.hs Visa fil

@@ -75,7 +75,7 @@ encodeStreamByNameWith :: ToNamedRecord a
75 75
                        -> IO (OutputStream a)      -- ^ New @OutputStream@.
76 76
 encodeStreamByNameWith opts hdr output = do
77 77
   ref <- newIORef opts
78
-  makeOutputStream $ dispatch (\opts' -> encodeByNameWith opts' hdr) ref output
78
+  makeOutputStream $ dispatch (`encodeByNameWith` hdr) ref output
79 79
 
80 80
 --------------------------------------------------------------------------------
81 81
 -- | Encode records, ensuring that the header is written no more than once.

+ 0
- 1
src/System/IO/Streams/Csv/Tutorial.hs Visa fil

@@ -30,7 +30,6 @@ module System.IO.Streams.Csv.Tutorial
30 30
        ) where
31 31
 
32 32
 --------------------------------------------------------------------------------
33
-import Control.Applicative
34 33
 import Control.Monad
35 34
 import Data.Csv
36 35
 import qualified Data.Vector as V

+ 3
- 3
test/test.hs Visa fil

@@ -19,7 +19,7 @@ module Main (main) where
19 19
 import Control.Monad
20 20
 import Data.ByteString (ByteString)
21 21
 import qualified Data.ByteString as BS
22
-import Data.Csv hiding (Record, NamedRecord, record)
22
+import Data.Csv hiding (Record, NamedRecord, record, header)
23 23
 import qualified Data.Vector as V
24 24
 import System.IO.Streams (InputStream, OutputStream)
25 25
 import qualified System.IO.Streams as Streams
@@ -96,8 +96,8 @@ prop_indexedRoundTrip recsIn = not (null recsIn) ==> monadicIO $ do
96 96
 --------------------------------------------------------------------------------
97 97
 tests :: TestTree
98 98
 tests = testGroup "Tests"
99
-        [ QC.testProperty "namedRoundTrip"   $ prop_namedRoundTrip
100
-        , QC.testProperty "indexedRoundTrip" $ prop_indexedRoundTrip
99
+        [ QC.testProperty "namedRoundTrip"   prop_namedRoundTrip
100
+        , QC.testProperty "indexedRoundTrip" prop_indexedRoundTrip
101 101
         ]
102 102
 
103 103
 --------------------------------------------------------------------------------

+ 0
- 1
util

@@ -1 +0,0 @@
1
-Subproject commit 0abebb0ed57b28485a56380c0422dcec74cabc37

Laddar…
Avbryt
Spara