implemented slurpRawCSV

This commit is contained in:
Jonathan Lamothe 2022-04-21 21:45:42 -04:00
parent 8533e84caa
commit 2af6966192

View File

@ -28,6 +28,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
module Data.CSV.Sip (
-- * Read an entire CSV file
slurpCSV,
slurpRawCSV,
-- * Conduits
labelFields,
decodeRows,
@ -61,6 +62,10 @@ import Data.Word (Word8)
slurpCSV :: MonadResource m => FilePath -> m [[T.Text]]
slurpCSV file = runConduit $ sourceFile file .| decodeRows .| consume
-- | read an entire CSV file in raw mode
slurpRawCSV :: MonadResource m => FilePath -> m [[BS.ByteString]]
slurpRawCSV file = runConduit $ sourceFile file .| decodeRawRows .| consume
-- | read a CSV stream, using the first row as a header containing
-- field labels
labelFields :: (Monad m, Ord a) => ConduitT [a] (M.Map a a) m ()