You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decodes can work with spacing and quoting information - for example, using raw it is possible to write a decoder which only succeeds when its input is quoted.
The inverse is not true of Encodes. An encode cannot specify its own spacing or quoting. Currently this is set uniformly and applied to the encoding process as a whole.
I've been contacted with a request to support an Encode of type Encode (Maybe ByteString) with the following behaviour:
In the case of Nothing, produce an empty, unquoted field. In the case of Just x, encode the ByteString x, surrounded by double double quotes. Even if x == "". So in this CSV, the empty quoted field is semantically different to the empty unquoted field.
Encoding should be changed so that this (and much more!) is possible. This will likely require some changes to the structure of Encode, so it would be preferable to write benchmarks for encoding before changing it.
The text was updated successfully, but these errors were encountered:
Seconded. I would love to be able to only quote strings (potentially) containing commas. Integers and floats in my world need not be quoted. Ditto for dates.
Decodes can work with spacing and quoting information - for example, using
raw
it is possible to write a decoder which only succeeds when its input is quoted.The inverse is not true of Encodes. An encode cannot specify its own spacing or quoting. Currently this is set uniformly and applied to the encoding process as a whole.
I've been contacted with a request to support an Encode of type
Encode (Maybe ByteString)
with the following behaviour:In the case of
Nothing
, produce an empty, unquoted field. In the case ofJust x
, encode the ByteStringx
, surrounded by double double quotes. Even ifx == ""
. So in this CSV, the empty quoted field is semantically different to the empty unquoted field.Encoding should be changed so that this (and much more!) is possible. This will likely require some changes to the structure of
Encode
, so it would be preferable to write benchmarks for encoding before changing it.The text was updated successfully, but these errors were encountered: