documentation for slurpCSV and slurpRawCSV

This commit is contained in:
Jonathan Lamothe 2022-04-21 22:23:26 -04:00
parent 2af6966192
commit 35130eeae1

View File

@ -59,11 +59,19 @@ import Data.Text.Encoding (decodeUtf8')
import Data.Word (Word8)
-- | read an entire CSV file
slurpCSV :: MonadResource m => FilePath -> m [[T.Text]]
slurpCSV
:: MonadResource m
=> FilePath
-- ^ the path to the file to read
-> 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
:: MonadResource m
=> FilePath
-- ^ the path to the file to read
-> m [[BS.ByteString]]
slurpRawCSV file = runConduit $ sourceFile file .| decodeRawRows .| consume
-- | read a CSV stream, using the first row as a header containing