Hacker News new | past | comments | ask | show | jobs | submit login
Good Haskell source to read and learn from (stackoverflow.com)
118 points by wicknicks on June 19, 2011 | hide | past | favorite | 7 comments



Haskell might be the strangest community of programmers (in a good way?). There's different styles depending on what grad. school you went to?

Can anyone elaborate on "why" this is, and why it isn't true (or is substantially less true) for other languages?


Flexibility of the language I imagine.

Function application: point free or not? Control flow: Monadic? Continuation passing style? Do you prefer to use Functors and fmap or list comprehensions to build lists? etc etc.

In Haskell it's natural to define new functions which embody the control flow you want to express. This means that the way you prefer to solve programming problems tends to be reflected in the structure of your programs in a much more obvious way. It's a bit like Lisp in that sense: consider that in lisp, you might write appropriate macros to structure the solution to your problem, and your choice of solution will then show up in the syntax of the code you write in a more obvious fashion than if you were writing in a curly-brace language, where the fundamental atoms of code remain the same regardless of your style of programming.


To add to your comment: laziness also enables much of this flexibility.


There were something like 8 research groups involved in inventing the language, and at each group there had been previous proto-Haskell languages in house. As a result there were different styles that emerged. By the mid-2000s though, there's a fairly universal style based on Glasgow, IMO.


Haskell is extremely extensible. In beginner tutorials, it's normal to implement subsets of other languages (Perl, Javascript, Lisp) as exercises. Often, the game seems to be making a domain-specific language uniquely suited to the problem you're working on.


I'd have to disagree with the recommendation for Darcs. I haven't seen any pretty code in Darcs, and some of it is incredibly hairy (the HTTP download module using Curl is pretty horrific).


you might call me crazy, but I get physically excited reading some of that code :D




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: