Compare commits

...

3 Commits

Author SHA1 Message Date
22b6942900 changed types of encodeCSV and encodeRawCSV
...to be more generic, the type now allows the to take any kind of input
2022-04-24 22:14:30 -04:00
c1e9fb7b8e typo 2022-04-24 22:13:07 -04:00
82085eaaf9 note about pull requests 2022-04-24 22:11:28 -04:00
2 changed files with 6 additions and 3 deletions

View File

@@ -16,3 +16,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
## Executive Summary
This library allows for reading and writing to and from CSV files in a streaming manner. Files can be read and written to on a row-by-row basis allowing larger files to be worked with, since the whole file doesn't have to be loaded to manipulate it. It is based on the [conduit](https://hackage.haskell.org/package/conduit] library.
## Pull Requests
Please make pull requests to the `dev` branch.

View File

@@ -153,7 +153,7 @@ encodeCSV
:: Monad m
=> [[T.Text]]
-- ^ the data being encoded, organized into rows and fields
-> ConduitT () BS.ByteString m ()
-> ConduitT o BS.ByteString m ()
encodeCSV csv = sourceList csv .| encodeRows
-- | encode an entire CSV file
@@ -161,7 +161,7 @@ encodeRawCSV
:: Monad m
=> [[BS.ByteString]]
-- ^ the data being encoded, organized into rows and fields
-> ConduitT () BS.ByteString m ()
-> ConduitT o BS.ByteString m ()
encodeRawCSV csv = sourceList csv .| encodeRawRows
-- | Writes a stream of Text-based rows to a CSV file
@@ -217,7 +217,7 @@ decodeUTF8 bs = case decodeUtf8' bs of
Left _ -> Nothing
Right txt -> Just txt
-- | convert a stream to ByteStrings to a string of bytes
-- | convert a stream to ByteStrings to a stream of bytes
toBytes :: Monad m => ConduitT BS.ByteString Word8 m ()
toBytes = await >>= \case
Just bs -> do