I think this might be some of the most beautiful code I've seen in a long while value :: Parser Value value = List (char8 '(' *> sepBy value (takeWhile1 isSpace_w8) Number . fst . fromJust . B.readInteger takeWhile1 isDigit_w8 Symbol takeWhile1 (inClass "A-Za-z\\-") The power of parser combinators representing the elegant lisp syntax.
I'm familiar with parser combinators, but not the Attoparsec or other libraries. Furthermore, I have limited Haskel experience, so I'm struggling to read this. In particular, the use of symbols and overall terseness are hard to get through. I'm also really uncomfortable with the order of operations of all these operators. Now, I know that Hoogle exists, so I'm able to look these things up, but it's pretty tough to un…
This is why I've never identified with "code should comment itself".
I'm not afraid to admit it: I am a dumb programmer. As a dumb programmer, the only way for me to be a good programmer is to be effective.
To be effective, I need to minimize the "time spent understanding code" phase of software development. Furthermore, I will likely be working within a team.
The opposite of that is to be writing "prototype" code --- code which is written to explore the problem space and to gain a better understanding of specific patterns to best accomplish a goal.
But once the prototype phase is over, all of that code is deleted, and is replaced with commented code. (If possible, I try to explain each step of the algorithm in English, first, and then write the code. This is slower, but results in far fewer bugs and a more solid foundation.)
I look at it this way: when my life ends, either I will have gone as far as my own brain was able to take me --- or I will have gone as far as my team's brains were able to take us. I'm willing bet my life that teams of "less brilliant" people are more effective than individuals of excessive brilliance. I write my code accordingly.
-------------------
That said, there is no excuse for laziness. Even if I am merely "competent", it's important for me to strive to be brilliant, even if I'll never attain it.