Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simple testing

  • Loading branch information...
commit f854f176c1f684f57d7546e5b56ca0d9d5b03402 1 parent 90bd0af
@ozataman authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/Data/CSV/Conduit.hs
View
8 src/Data/CSV/Conduit.hs
@@ -25,6 +25,7 @@ import Data.ByteString.Internal (c2w)
import Data.Conduit as C
import Data.Conduit.Attoparsec
import Data.Conduit.Binary
+import Data.Conduit.Text
import qualified Data.Map as M
import Data.String
import Data.Text (Text)
@@ -32,7 +33,6 @@ import qualified Data.Text as T
import Data.Word (Word8)
import Safe (headMay)
import System.Directory
-import System.IO
import System.PosixCompat.Files (getFileStatus, fileSize)
-------------------------------------------------------------------------------
import qualified Data.CSV.Conduit.Parser.ByteString as BSP
@@ -166,7 +166,9 @@ fromCSVMap set = conduitState False push close
test :: IO ()
test = runResourceT $
sourceFile "test/BigFile.csv" $=
+ decode utf8 $=
(intoCSV defCSVSettings
- :: forall m. MonadResource m => Conduit ByteString m (MapRow ByteString)) $=
- fromCSV defCSVSettings $$
+ :: forall m. MonadResource m => Conduit Text m (MapRow Text)) $=
+ fromCSV defCSVSettings $=
+ encode utf8 $$
sinkFile "test/BigFileOut.csv"
Please sign in to comment.
Something went wrong with that request. Please try again.