4 ms·
no i'm not. you cherry picked. tell me how readable this module is https://github.com/databrary/databrary/blob/master/Databrary/Controller/CSV.hs https://githu
by ice109 9y ago
no i'm not. you cherry picked. tell me how readable this module is
https://github.com/databrary/databrary/blob/master/Databrary/Controller/CSV.hs https://github.com/databrary/databrary/blob/master/Databrary...
with gems like
https://github.com/databrary/databrary/blob/master/Databrary/Controller/CSV.hs#L60 https://github.com/databrary/databrary/blob/master/Databrary...
and
https://github.com/databrary/databrary/blob/master/Databrary/Controller/CSV.hs#L101 https://github.com/databrary/databrary/blob/master/Databrary...
and
https://github.com/databrary/databrary/blob/master/Databrary/Store/Zip.hs https://github.com/databrary/databrary/blob/master/Databrary...
and
https://github.com/databrary/databrary/blob/master/Databrary/Ingest/JSON.hs#L103 https://github.com/databrary/databrary/blob/master/Databrary...
- dllthomas 9y agoYou can write unreadable code in any language. "Look, here's some unreadable code in your language" doesn't tell us much of anything. That said... looking at your first example, it's really not that bad. It could probably be rewritten to be quite a bit clearer, but even knowing nothing about the library or surrounding context, it doesn't take me that much thinking to work out what's going on: We have a dictionary implemented as a sorted list of pairs, and a list of records we want to update that dictionary with (after some transformation). If there are no records, we give back the dictionary unmodified. If there is no dictionary, we build one out of the records. If there is both a dictionary and a bunch of records, we do a recursive merge of the two - compare the heads of each list, cons the smaller on the result of the appropriate recursive call.
- tome 9y ago> you cherry picked That's exactly what I was asked to do!