2 ms·
How do I represent an Option<Int> in a CSV file?
by msla 3y ago
How do I represent an Option<Int> in a CSV file?
- smcin 3y agoI assume you mean the Scala type Option<Int>, and that's an integer type which can be NaN, right?
- msla 3y agoNo, I only used Option<Int> because the person I replied to did, and I don't expect them to know what Maybe Int means.
- deathanatos 3y agoI mean … CSV hasn't a notion of Option, or Int, so you'd have to define your own. But you don't have to use what the article calls a "sentinel value" (i.e., you don't have to dedicate -2489391827 as "null") to do it: simply "null" for None/Null/Nothing, and the integer for Some(<int>) / Just int would work.
- icedchai 3y agoAn empty string could be interpreted as a null integer. Now how do you do that with a string? If you have to ask these questions, CSV is probably not the right format.