4 ms·
I'm pretty sure this isn't the idomatic way to parse a CSV file in Haskell. It's just what I found from a quick Google search. I'm sure someone else could do
by jackpirate 14y ago
I'm pretty sure this isn't the idomatic way to parse a CSV file in Haskell. It's just what I found from a quick Google search. I'm sure someone else could do better.
The rest of the code is basically calling sum and filter on the data, and it would be almost exactly the same in Python, or even C++.
This is definitely NOT true. The rest of the code is about using algebraic manipulations, like group operations on the data structures. This is certainly possible in other languages, it's just never done and it's not idiomatic.
- jlarocco 14y ago> I'm pretty sure this isn't the idomatic way to parse a CSV file in Haskell. It's just what I found from a quick Google search. I'm sure someone else could do better. Isn't that the point, though? In Haskell it was so difficult to read a CSV file that you had to Google it. In Python it was immediately obvious how it should be done.
- jackpirate 14y agoIn Python it was immediately obvious how it should be done What? I'd have to Google it in Python too.
- politician 14y agoFWIW, I really enjoyed the article, and appreciated the example dataset -- usually this literature is quite dry. Do you know if there is any monoid documentation that enumerates the various properties as something like C# interfaces and then explains what the derived types are? I think that would help me and a lot of other people who don't know as much abstract algebra or find it hard to connect with their day to day work.
- jackpirate 14y agoThanks for the kind words. Sorry, I'm not familiar with any non-functional languages that take advantage of algebra for programming.