4 ms·
On the other hand, that one time you just need a simple library for something, you get to use some guy's pet experiment for learning one of these concepts (Mono
by codewright 14y ago
On the other hand, that one time you just need a simple library for something, you get to use some guy's pet experiment for learning one of these concepts (Monoids, Monads, Monad transformers, Comonads, Arrows, Lenses, Foldables, Iteratees, Functional-Reactive Programming) you haven't learned yet just to parse some XML.
Yeah, a real productivity booster. It's like batteries included but with C4 attached to every battery.
Sometimes, people have work to do.
- papsosouid 14y agoYeah, those tricky monoids. So hard to learn, and even harder to use a library based on them. You have a whole whopping one function to learn, that does some incredibly convoluted and arcane nonsense called "appending"? What a horrible language. You should definitely devote more time to complaining about ridiculous strawmen like this, it seems like a very good use of time.
- codewright 14y agoI shouldn't have to learn what parser combinators are to just rip a few things out of a tree of XML.
- papsosouid 14y agoGood, good. Now take it to the next level. Rather than just using a scary word that means something very ordinary and mundane, try making up totally nonsense combinations. Like "I shouldn't have to learn co-recursive monomorphic functoid transformers just to open a file!".
- bjourne 14y agoHere is some of my code to parse html: tstamp <- this ! "data-timestamp" >>> arr parseTime -< el (path, score) <- css "td[class~=score-time] a" >>> (this ! "href") &&& (getAllText >>> arr parseScore) -< el So yes, you do have to learn about arrow syntax in order to use HXT efficiently. For most newbies it is not an easy concept to grasp, not helped by the fact that HXT isn't a very well documented library.
- gosub 14y agotstamp <- this ! "data-timestamp" >>> arr parseTime -< el This, on the other hand, is one of the thing I don't like about Haskell: there are 4 operators on this line, and no easy way to see, at a glance, their precedence. Also, some operators are "mentally interpreted" as flowing data left to right or right to left; changing the direction mid-statement, I find confusing. I have the same problem when unix shell commands are expressed like this: program < input > output
- papsosouid 14y ago"Use >>> like a pipe in unix" is not an easy concept to grasp?