Îõ³h,:ð6®      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­1.0.1.0 Safe-Inferred"®Nonem¯0Control the rendering of floating point numbers.°Scientific notation (e.g. 2.3e123).±Standard decimal notation.²(Use decimal notation for values between 0.1 and  9,999,999$, and scientific notation otherwise.³³! takes a base and a non-negative ´Ë number, and returns a list of digits and an exponent. In particular, if x>=0, and *floatToDigits base x = ([d1,d2,...,dn], e)then  n >= 1 x = 0.d1d2...dn * (base**e) 0 <= di <= base-1µ%Unsafe conversion for decimal digits.¶·Ozgun Ataman, Johan TibellBSD3!Ozgun Ataman  experimentalNone"ÃÅÙÞu=ñConversion of a field to a value might fail e.g. if the field is malformed. This possibility is captured by the  type, which lets you compose several field conversions together in such a way that if any of them fail, the whole record conversion fails.¸Success continuation.¹Failure continuation.3A type that can be converted to a single CSV field.Example type and instance: ©{-# LANGUAGE OverloadedStrings #-} data Color = Red | Green | Blue instance ToField Color where toField Red = "R" toField Green = "G" toField Blue = "B"×A type that can be converted from a single CSV field, with the possibility of failure.When writing an instance, use º, », or ¼' to make a conversion fail, e.g. if a ' can't be converted to the given type.Example type and instance: ð{-# LANGUAGE OverloadedStrings #-} data Color = Red | Green | Blue instance FromField Color where parseField s | s == "R" = pure Red | s == "G" = pure Green | s == "B" = pure Blue | otherwise = mzero4A type that can be converted to a single CSV record.An example type and instance: ²data Person = Person { name :: !Text, age :: !Int } instance ToNamedRecord Person where toNamedRecord (Person name age) = namedRecord [ "name" .= name, "age" .= age] ØA type that can be converted from a single CSV record, with the possibility of failure.When writing an instance, use º, », or ¼' to make a conversion fail, e.g. if a " has the wrong number of columns.Given this example data: name,age John,56 Jane,55$here's an example type and instance: ï{-# LANGUAGE OverloadedStrings #-} data Person = Person { name :: !Text, age :: !Int } instance FromNamedRecord Person where parseNamedRecord m = Person <$> m .: "name" <*> m .: "age"Note the use of the OverloadedStrings# language extension which enables   ) values to be written as string literals.4A type that can be converted to a single CSV record.An example type and instance:  data Person = Person { name :: !Text, age :: !Int } instance ToRecord Person where toRecord (Person name age) = record [ toField name, toField age]Outputs data on this form: John,56 Jane,55äHaskell lacks a single-element tuple type, so if you CSV data with just one column you can use the + type to represent a single-column result.ØA type that can be converted from a single CSV record, with the possibility of failure.When writing an instance, use º, », or ¼' to make a conversion fail, e.g. if a " has the wrong number of columns.Given this example data: John,56 Jane,55$here's an example type and instance: òdata Person = Person { name :: !Text, age :: !Int } instance FromRecord Person where parseRecord v | length v == 2 = Person <$> v .! 0 <*> v .! 1 | otherwise = mzeroA single field within a record.4A record corresponds to a single line in a CSV file.éA wrapper around custom haskell types that can directly be converted/parsed from an incoming CSV stream.ÛWe define this wrapper to stop GHC from complaining about overlapping instances. Just use ( to get your object out of the wrapper.'A shorthand for the ByteString case of MapRow Retrieve the n-th field in the given record. The result is ºê if the value cannot be converted to the desired type. Raises an exception if the index is out of bounds.9 is a simple convenience function that is equivalent to  (v ½ idx)À. If you're certain that the index is not out of bounds, using ! is somewhat faster.  Alias for .!Like  but without bounds checking.">Retrieve a field in the given record by name. The result is ºÒ if the field is missing or if the value cannot be converted to the desired type.$ Alias for ".%9Construct a pair from a name and a value. For use with (.& Alias for %.'"Construct a record from a list of   s. Use  to convert values to   s for use with '.(3Construct a named record from a list of name-value    pairs. Use &2 to construct such a pair from a name and a value.*Run a , returning either ¾ errMsg or ¿ result. Forces the value in the ¾ or ¿( constructors to weak head normal form.ÞYou most likely won't need to use this function directly, but it's included for completeness.+Uses UTF-8 encoding.,Uses UTF-8 encoding.-Uses UTF-8 encoding.0Uses decimal encoding.1Uses decimal encoding.2Uses decimal encoding.3Uses decimal encoding.4Uses decimal encoding.5)Uses decimal encoding with optional sign.6)Uses decimal encoding with optional sign.7)Uses decimal encoding with optional sign.8)Uses decimal encoding with optional sign.9)Uses decimal encoding with optional sign.:)Uses decimal encoding with optional sign.;ÇUses decimal notation or scientific notation, depending on the number.<ÇUses decimal notation or scientific notation, depending on the number.=Uses UTF-8 encoding.>À is encoded as an   field.R8Assumes UTF-8 encoding. Fails on invalid byte sequences.S8Assumes UTF-8 encoding. Fails on invalid byte sequences.T8Assumes UTF-8 encoding. Fails on invalid byte sequences.W#Accepts an unsigned decimal number.X#Accepts an unsigned decimal number.Y#Accepts an unsigned decimal number.Z#Accepts an unsigned decimal number.[#Accepts an unsigned decimal number.\ Accepts a signed decimal number.] Accepts a signed decimal number.^ Accepts a signed decimal number._ Accepts a signed decimal number.` Accepts a signed decimal number.a Accepts a signed decimal number.bAccepts same syntax as rational.cAccepts same syntax as rational.dAssumes UTF-8 encoding.e Ignores the . Always succeeds.fÀ if the  is  , Á otherwise.* $&"#%()'*!  *  * !"#$%&'()  None"Ã"fAn  is a dictionary based on Õ where column names are keys and row's individual cell values are the values of the OMap . Unlike €, / preserves the insertion ordering of columns. ' is a reasonable default in most cases.€A € is a dictionary based on Ö where column names are keys and row's individual cell values are the values of the Map.A  is just a list of fields‚ˆSettings for a CSV file. This library is intended to be flexible and offer a way to process the majority of text data files out there.„ÁQuote character that may sometimes be present around fields. If ÀÊ is given, the library will never expect quotation even if it is present.…0Separator character to be used in between fieldsŠ Default settings for a CSV file. $csvSep = ',' csvQuoteChar = Just '"' ‰Š‹‚ƒ„…€†‡ˆ †ˆ‡‚„…ƒ‰Š‹€None#-‘ Try to parse given string as CSV’'Try to parse given string as 'Row Text'“ Parse CSV”Parse a CSV row“‘’”‘’”“None#Ø• Try to parse given string as CSV–-Try to parse given string as 'Row ByteString'— Parse CSV˜Parse a CSV row—•–˜•–˜—None "ÃÄÅÆÇÙÞ6:™Represents types rÎ that are CSV-like and can be converted to/from an underlying stream of type s). There is nothing scary about the type:sÏ represents stream types that can be converted to/from CSV rows. Examples are Â, à and Ä.râ represents the target CSV row representations that this library can work with. Examples are the  types, the Record type and the €Ó family of types. We can also convert directly to complex Haskell types using the å module that was borrowed from the cassava package, which was itself inspired by the aeson package.(Example #1: Basics Using Convenience API Ñimport Data.Conduit import Data.Conduit.Binary import Data.Conduit.List as CL import Data.CSV.Conduit myProcessor :: Conduit (Row Text) m (Row Text) myProcessor = CL.map reverse test = runResourceT $ transformCSV defCSVSettings (sourceFile "input.csv") myProcessor (sinkFile "output.csv")$Example #2: Basics Using Conduit API æimport Data.Conduit import Data.Conduit.Binary import Data.CSV.Conduit myProcessor :: Conduit (MapRow Text) m (MapRow Text) myProcessor = undefined test = runResourceT $ runConduit $ sourceFile "test/BigFile.csv" .| intoCSV defCSVSettings .| myProcessor .| (writeHeaders defCSVSettings >> fromCSV defCSVSettings) .| sinkFile "test/BigFileOut.csv"š4Convert a CSV row into strict ByteString equivalent.›Turn a stream of sÜ into a stream of CSV row type. An example would be parsing a ByteString stream as rows of € Ã.œ4Turn a stream of CSV row type back into a stream of s-. An example would be rendering a stream of   rows as Ã.ÜWrite headers AND the row into the output stream, once. If you don't call this while using €Ò family of row types, then your resulting output will NOT have any headers in it.!Usage: Just chain this using the Å instance in your pipeline: ÏrunConduit $ ... .| writeHeaders settings >> fromCSV settings .| sinkFile "..."Ÿ3Read the entire contents of a CSV file into memory. ãA simple way to decode a CSV string. Don't be alarmed by the polymorphic nature of the signature. s! is the type for the string and v is a kind of Vector here.For example for Â:s <- LB.readFile "my.csv"ÏdecodeCSV defCSVSettings s :: Either SomeException (Vector (Vector ByteString))1will work as long as the data is comma separated.¡&Write CSV data into file. As we use a Â, sink, you'll need to get your data into a  stream type.¢ÒMap over the rows of a CSV file. Provided for convenience for historical reasons.*An easy way to run this function would be % after feeding it all the arguments.£ÉLike transformCSV' but uses the same settings for both input and output.¤ÍGeneral purpose CSV transformer. Apply a list-like processing function from ï to the rows of a CSV stream. You need to provide a stream data source, a transformer and a stream data sink.*An easy way to run this function would be % after feeding it all the arguments.5Example - map a function over the rows of a CSV file: ÊtransformCSV setIn setOut (sourceFile inFile) (C.map f) (sinkFile outFile)ÆÉAn efficient sink that incrementally grows a vector from the input stream¦ÅConversion of stream directly to/from a custom complex haskell type.¨Generic €" instance; any stream type with a  instance automatically gets a € instance.© Support for parsing rows in the Vector form.ª instance using Ä based on Â… stream. Please note this uses the ByteString operations underneath and has lots of unnecessary overhead. Included for convenience.« instance using à based on  stream¬ instance using í instance using Ÿ%Settings to use in deciphering stream Input file¡ CSV Settings Target fileWrite vs. append mode List of rows¢.Settings to use both for both input and outputA mapping function Input file Output file£-Settings to be used for both input and output1A raw stream data source. Ex: 'sourceFile inFile'A transforming conduit.A raw stream data sink. Ex: 'sinkFile outFile'¤Settings to be used for inputSettings to be used for output1A raw stream data source. Ex: 'sourceFile inFile'A transforming conduit.A raw stream data sink. Ex: 'sinkFile outFile' ¢Ÿ£¤¡žŠ™œ›š‚ƒ„…€ Ÿ¡£¤¢ž™š›œ‚ƒ…„Š€Ç !"#$%&'''()*+,---.///0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–––—–˜™š›œžŸ ¡¢£¤¥¦§¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃĽůÇÈÉÊ˽¾ ½¾Ì½ÍÎÏÐѽÒÓ½ÒÔ½ÕÖ½Õ×ØÙ ÚÛܽ¾Ý½¾Þßàcsv-conduit-1.0.1.0-inplaceData.CSV.ConduitData.CSV.Conduit.ConversionData.CSV.Conduit.TypesData.CSV.Conduit.Parser.Text"Data.CSV.Conduit.Parser.ByteString csv-conduitData.CSV.Conduit.Monoid$Data.CSV.Conduit.Conversion.InternalB8 ByteStringBempty9Data.MapOrderedDataMap Conversion Data.ConduitListÐresourcet-1.3.0-0135680eb517982c2f70c9809be28ad5263eb77086260d0f50c9677eca4733aeControl.Monad.Trans.Resource runResourceTParserToFieldtoField FromField parseFieldToNamedRecordOrderedtoNamedRecordOrdered ToNamedRecord toNamedRecordFromNamedRecordOrderedparseNamedRecordOrderedFromNamedRecordparseNamedRecordToRecordtoRecordOnlyfromOnly FromRecord parseRecordFieldRecord NamedOrderedgetNamedOrderedNamedgetNamedNamedRecordOrdered NamedRecordindex.! unsafeIndexlookup lookupOrdered.: namedField.=record namedRecordnamedRecordOrdered runParser $fToFieldList $fToFieldText$fToFieldText0$fToFieldByteString$fToFieldByteString0$fToFieldWord64$fToFieldWord32$fToFieldWord16$fToFieldWord8 $fToFieldWord$fToFieldInt64$fToFieldInt32$fToFieldInt16 $fToFieldInt8$fToFieldInteger $fToFieldInt$fToFieldFloat$fToFieldDouble $fToFieldChar$fToFieldMaybe$fToNamedRecordOrderedOMap$fToNamedRecordMap$fToRecordVector$fToRecordVector0$fToRecordList$fToRecordTuple7$fToRecordTuple6$fToRecordTuple5$fToRecordTuple4$fToRecordTuple3$fToRecordTuple2$fToRecordOnly$fSemigroupParser$fMonadPlusParser$fAlternativeParser$fApplicativeParser$fFunctorParser$fMonadFailParser $fMonadParser$fFromFieldList$fFromFieldText$fFromFieldText0$fFromFieldByteString$fFromFieldByteString0$fFromFieldWord64$fFromFieldWord32$fFromFieldWord16$fFromFieldWord8$fFromFieldWord$fFromFieldInt64$fFromFieldInt32$fFromFieldInt16$fFromFieldInt8$fFromFieldInteger$fFromFieldInt$fFromFieldFloat$fFromFieldDouble$fFromFieldChar$fFromFieldUnit$fFromFieldMaybe$fFromNamedRecordOrderedOMap$fFromNamedRecordMap$fFromRecordVector$fFromRecordVector0$fFromRecordList$fFromRecordTuple7$fFromRecordTuple6$fFromRecordTuple5$fFromRecordTuple4$fFromRecordTuple3$fFromRecordTuple2$fFromRecordOnly$fEqOnly $fOrdOnly $fReadOnly $fShowOnly$fEqNamedOrdered$fShowNamedOrdered$fReadNamedOrdered$fOrdNamedOrdered $fEqNamed $fShowNamed $fReadNamed $fOrdNamed OrderedMapRowMapRowRow CSVSettingscsvQuoteCharAndStylecsvSep QuoteEmpty DoQuoteEmptyDontQuoteEmpty csvQuoteChardefCSVSettingsdefDontQuoteEmptyCSVSettings$fDefaultCSVSettings$fShowCSVSettings$fEqCSVSettings$fShowQuoteEmpty$fEqQuoteEmptyparseCSVparseRowcsvrowCSVrowToStrintoCSVfromCSV writeHeaderswriteHeadersOrdered readCSVFile decodeCSV writeCSVFile mapCSVFile transformCSV transformCSV'$fCSVsNamedOrdered $fCSVsNamed $fCSVsOMap $fCSVsMap $fCSVsVector$fCSVByteStringList$fCSVByteStringList0 $fCSVTextList$fCSVByteStringList1 ghc-internalGHC.Internal.Base<>FPFormatExponentFixedGeneric floatToDigitsGHC.Internal.Float RealFloati2ddecimal realFloatSuccessFailuremzeroGHC.Internal.Control.Monad.FailfailÐvector-0.13.1.0-a631eef576f6c2a9be822cec124d36c4458f5db2fc7ca3e9ddfde776f04d20c6 Data.Vector!GHC.Internal.Data.EitherLeftRightGHC.Internal.MaybeNothingJustbytestring-0.12.1.0-6739Data.ByteString.Internal.Typetext-2.1.1-e965Data.Text.InternalTextStringMonad sinkVector