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
The FSharpAux.IO.SeqIO.Seq.CSV function with the parameter flatten = false, does not perform as intended.
Repro steps
Define a Record type with a field of type array.
FSharpAux.IO.SeqIO.Seq.CSV function with the parameter flatten = false, using an instance of your type with an array of Length > 20.
Look at the string.
Expected behavior
Nicely formatted output.
Actual behavior
The array is spread accross mutliple lines if it exceeds a certain length. This happens because "sprintf "%A" x" is used to format collections. This introduces line-brakes into the string.
Known workarounds
FSharpAux.IO.SeqIO.Seq.CSV calls FSharpAux.IO.SeqIO.Seq.CSVwith. Simply replace the parameter strFunction with a version that does the formatting correctly.
The text was updated successfully, but these errors were encountered:
It fixes the bug but also introduces two little changes:
I emitted the "[|" and "|]" marks at the beginning and ending of e.g. arrays. I think when parsing collections they do no real favor and can therefore be ommited.
In lines 35-38 I assure that the inner separator is different from the outer one. Otherwise selecting ";" as a separator could break the parsing again. We could go for something more explicit but this would change the function signatures.
The fix for the flattening of the array looks good to me. Where I'm not exactly sure how to handle it is the "backup" separator. Currently there is a list with commonly used separators and the first one that isn't the separator used for writing is selected. As far as i can see it, only the first two separators in this list are able to be selected, so the third one is obsolete. If this is the course we want to take maybe we should pick two separators only. Another option would be to add an optional parameter for the backup separator, but this would require some rewriting of the functions.
Description
The FSharpAux.IO.SeqIO.Seq.CSV function with the parameter flatten = false, does not perform as intended.
Repro steps
Expected behavior
Nicely formatted output.
Actual behavior
The array is spread accross mutliple lines if it exceeds a certain length. This happens because "sprintf "%A" x" is used to format collections. This introduces line-brakes into the string.
Known workarounds
FSharpAux.IO.SeqIO.Seq.CSV calls FSharpAux.IO.SeqIO.Seq.CSVwith. Simply replace the parameter strFunction with a version that does the formatting correctly.
The text was updated successfully, but these errors were encountered: