11 ms·
Learn You a Haskell for Great Good (2008)
- deleted 12y ago[deleted]
- XYEaQMZJvS 12y agoThat sun cracks me up almost every time.
- NiceOneBrah 12y agoMy favorite illustration is the monoidal pirate ship: http://s3.amazonaws.com/lyah/pirateship.png http://s3.amazonaws.com/lyah/pirateship.png
- loosescrews 12y agoMy favorite is: "If we think of a list as a monster, here's what's what." http://s3.amazonaws.com/lyah/listmonster.png http://s3.amazonaws.com/lyah/listmonster.png
- TazeTSchnitzel 12y agoI still can't get over the 'Girlfriend' gag.
- mgraczyk 12y agoI'm currently working through this book. Overall it seems like a good introduction but I wish it had exercises at the end of each section. I learn best by working through specific problems.
- nescoiquid 12y agoWord. There's Real World Haskell by Don Stewart (http://book.realworldhaskell.org/read/index.html http://book.realworldhaskell.org/read/index.html), though the order of exposition is different and your mileage may vary with the exercises. I did find that "Programming in Haskell" by Graham Hutton was a very clear read and had good programming exercises.
- sridca 12y agoThe recently released Thinking Functionally with Haskell by Richard Bird includes exercises. I like the fact that this book is a little more rigorous than LYAH.
- merijnv 12y agoExtensive list of resources including many that have exercises: https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell
- flurdy 12y agoWe had a Learn you a Haskell book club at work a few years ago and a friend made these very good excercises: https://github.com/noelmarkham/learn-you-a-haskell-exercises https://github.com/noelmarkham/learn-you-a-haskell-exercises
- deleted 12y ago[deleted]
- akurilin 12y agoWhat does "lack of applications" mean? As in, not that many apps are written in it, or that it's not applicable to many of them? It's a fairly general-purpose language, you can get most common programming tasks done in it pretty well.
- rpglover64 12y agoIf you like math (I mean stuff like set theory and abstract algebra, not arithmetic and high-school math), then Haskell is wonderful. I find programming in it to be more enjoyable than in any other language. It will also make you think differently, which is a useful feature if you're learning a language to expand your horizons. It's also a gateway language to more bleeding edge aspects of language design. That said, I find that knowing enough C to fix build and configuration problems in open source projects has been more useful than Haskell for me.
- SamReidHughes 12y agoI'd say it's pretty good. It's hard to give advice because I learned Haskell when I already had a decent college-student understanding of C++, so Haskell added diversity to my education where C wouldn't. It's good to learn languages that are different, and languages that make different things cheap -- Haskell made defining types and also made static type checking a lot cheaper than other languages in 2005. It's also easier to usefully learn than C, because I think you really need to do stuff with a language in order to be good at it, and floundering around as a noob in C isn't necessarily the best way to do that, it seems to me like you can learn ho to use it wisely, more productively, when coming from a background with some experience. You can do useful stuff with Haskell pretty quickly, which lets you go farther with it.
- pjmlp 12y agoNice post. I just don't get the 2005 date, given the history of ML derived languages.
- clark-kent 12y agoWhat is a good online reference to learn about "Monads" for beginners? Someone posted a reference here on HN sometime ago but I lost it. Edit: The book was enjoyable and a delight to read, but I started struggling to keep up from Chapter 8. as it went into Monoids and Monads, I feel like I need to read other tutorials before coming back to it.
- TazeTSchnitzel 12y agoWell, Learn You a Haskell's explanation of Monads in Haskell seems alright.
- danem 12y agoThere was quite a long discussion about this on the Haskell subreddit this past week[1], and indeed this topic seems to always be something newcomers get caught up with. My advice is to use the language until you gain an intuition for them. Despite being rather simple, I found it was difficult to fully appreciate them without a decent amount of exposure. Really though, monads aren't what Haskell is all about, and don't let an incomplete understanding of them stop you from diving in. [1] http://www.reddit.com/r/haskell/comments/2vm0ed/is_there_a_good_succinct_metaphorfree_monad/ http://www.reddit.com/r/haskell/comments/2vm0ed/is_there_a_g...
- Retra 12y agoI recommend this to anybody who wants to learn about Haskell's important data types: https://wiki.haskell.org/Typeclassopedia https://wiki.haskell.org/Typeclassopedia
- bstamour 12y agoI found the typeclassopedia to be really helpful after I'd been programming in Haskell for a few years. It really helped tie all of the types together, but a part of me thinks that it might be a bit overkill for someone who's just dipping their toes in for the first time.
- Retra 12y ago
- yomslice 12y agoThis book was excellent for helping me learn Haskell, but the gendered language and fat-shaming jokes made me feel very uncomfortable, eg: "You're fat! Lose some weight, fatty!","You're supposedly normal. Pffft, I bet you're ugly!" and "You're a whale, congratulations!", "Sure, we could just type them all out but obviously that's not a solution for gentlemen who demand excellence from their programming languages."
- wyager 12y agoClearly the author is going for a casual, conversational, jocular attitude. That's part of what makes LYAH so approachable. If you want dry, sanitized, bowdlerized instruction, LYAH is not the place to look.
- RMarcus 12y agoIt seems as though individuals who don't want to feel bad about their weight and gender might also feel that LYAH is not the place to look. I guess LYAH and I just aren't a good "culture fit." It's a real shame too -- without these completely unnecessary comments that add no value, this is an excellent way to learn Haskell! I've become comfortable with my whale-like properties and I'm male, so I had the lovely privilege of learning from this particular resource. It would be great if people not in my position could too. Maybe the author did some research and determined that the added "humor" and "casual attitude" engages more readers than it turns away. I'd still want to know the demographics of both groups involved, because I suspect one of the groups looks a lot like me and the other does not.
- oldmanjay 12y agoI feel like some time in the 90s, people got this idea in their head that their sensitivities should be everyone's problem. Since you exhibit this, can you explain why? I'm super curious.
- aninhumer 12y agoBecause for most of the cases people really care about, it's easier for you to change your language then it is for every offended person to not feel upset when you offend them. This might not be the case if there's a downside to the alternative language, or if the feeling of offense is unreasonable, but this is a decision you should actively make, not passively dismiss as "not my problem". In this case, I think the language could easily have been changed without significantly weakening the text.
- wyager 12y agoThis is what I used to learn Haskell a while back. It's a pretty darn good intro. I'm very glad I did it.
- RMarcus 12y agoWe'd be remiss not to mention the Erlang counterpart... http://learnyousomeerlang.com/ http://learnyousomeerlang.com/
- felixgallo 12y agoI think the current 'definitive' resource for learning Haskell is https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell, which has well-curated, comprehensive links.
- saosebastiao 12y agoI won't read that one on principle alone. The author (coolsunglasses on HN) runs around all the various forums (, threads, and subreddits) for other languages, trolling other users and making fun of their languages. He's a complete asshole. Besides, Real World Haskell and Learn You a Haskell are both extremely competent books/tutorials.
- laex 12y agoShould I learn oCaml instead ? Looks appealing because companies like Facebook are using it create tools like Flow ( https://github.com/facebook/flow https://github.com/facebook/flow ).
- LBarret 12y agoLearn the one you prefer but don't choose for this reason : Haskell is also very present at Facebook.
- berdario 12y agoFacebook is also creating tools with Haskell: https://github.com/facebook/Haxl https://github.com/facebook/Haxl My 2 cents: definitely _also_ learn OCaml down the line. But: - my pet peeve with OCaml is the lack of a builtin type for Unicode strings (the only other language still commonly used with this shortcoming is PHP), and this could be an issue if you plan to write some web app code that needs to be internationalized - OCaml is strict, Haskell is one of the very few languages that is non-strict: aside from the didactic purpose of exposing yoursefl to something different, that's a feature that can help reasoning about what your code is doing: http://augustss.blogspot.co.uk/2011/05/more-points-for-lazy-evaluation-in.html http://augustss.blogspot.co.uk/2011/05/more-points-for-lazy-... (then again, there're obviously downsides to non-strictness, and you might decide down the line that you prefer to write strict code in production... but it's good to know the alternatives)
- ufo 12y ago
- gambogi 12y agoSupremely useful reference: http://dev.stephendiehl.com/hask/ http://dev.stephendiehl.com/hask/
- QuantumRoar 12y agoHaskell is such a great language. I've been recommending this book for a while now. If you are in doubt whether you should start learning it, read this post by Jeff Bone: http://www.xent.com/pipermail/fork/Week-of-Mon-20070219/044101.html http://www.xent.com/pipermail/fork/Week-of-Mon-20070219/0441... After I read it, I immediately began learning Haskell. Since then, Haskell made my brain melt multiple times. But it has also enabled me to build an expression parser and analytic differentiator that I use every day (among other things, but that's what I'm most proud of). Such a program would be a lot harder to create, if it weren't for Haskell's ridiculously powerful type system and pattern matching. Also, after learning the Haskell way of things, I recognized the reasons for many issues I had with code written in another programming language. Don't just go out there and do object-oriented programming because everybody else seems to do it, often it is imperative (pun intended) to use the declarative (functional) programming paradigm to keep you out of debugging hell. edit: clarification
- amelius 12y agoI'm not sure if that link is NSFW or not :)
- QuantumRoar 12y agoIt's about programming languages! :D Although, I think, if someone reads it who's not familiar with programming languages, the reactions, when you tell them what Haskell and Python are, might range from hilarious to WTF.
- smcl 12y agoCertainly doesn't help with the perception of the tech industry as a boys club. I mean I know it may have been written in jest but I was personally cringing while reading it and figured it'd be at the very least a little alienating (at worst outright offensive) for any women who'd happen to read it. Maybe I'm being oversensitive, I just know I wouldn't write anything like that.
- QuantumRoar 12y ago
- greatabel 12y agoHaskell can be very handy at solving some puzzles.
- codygman 12y agoHaskell can be very handy for solving real world problems as well.
- mod3rn0 12y agoFor newcomers I'd suggest this introductory course by Erik Meijer: https://www.edx.org/course/introduction-functional-programming-delftx-fp101x https://www.edx.org/course/introduction-functional-programmi... . It's about FP, not strictly Haskell, but it really helped me starting with it and really stimulated my curiosity (and he really can explain hard concepts in a simple way imo). I started reading the book after I completed the course and helped giving an answer to a lot of questions I had during the course.
- nudpiedo 12y agoI always have been interested on haskell.... but it doesn't look to be enough practical. For example there is almost no information about how to write a smartphone videogame in haskell, even if it possible to trasnpile it to C or to Javascript. It is possible to interoperate with the host language? Does it perform well for high performance activities? Is it possible to isolate some kind of events in a thread? Edit: This lack of practical approach is what makes me hesitate in contrast to clojure (just to mention a language), especially if the only goal is to become again a "better developer" rediscovering functional terms and abstractions also documented in other languages.
- exDM69 12y agoYour fears are not warranted. Haskell is the most practical of the "research languages" out there, it's very mature and has good facilities for interfacing with the "real world". > For example there is almost no information about how to write a smartphone videogame in haskell This has been done before but most of the "hard stuff" here is getting your game built and deployed on a smartphone. You can find Haskell for Android articles if you look around. There are examples of game programming in Haskell too. > It is possible to interoperate with the host language? There is no concept of "host" lanugage, Haskell emits native code. You can call native code from Haskell and Haskell code from C or other native languages. > Does it perform well for high performance activities? Haskell is good enough for most "high performance" activities (it's one of the highest performing high level languages according to the debian shootout), but caveats may apply with long running processes and garbage collection, etc. > Is it possible to isolate some kind of events in a thread? Yes. Haskell has very nice threading facilities and high-level concurrency primitives, including stuff similar to "channels" from golang.
- rhizome31 12y agoI enjoyed working through this book. Actually it helped me learn enough Haskell to realize that I wasn't that interested in it. I found that it wasn't as safe as it claimed to be and that the tooling was not very good. There are some refreshing and interesting ideas, but overall I'm not sure it was worth my time.
- Confusion 12y agoI want to note that LYAH may not work for you if you have my kind of learning style. I need to solve concrete, realistic problems to creatively use the knowledge imparted on me. I can't just read stuff and understand. Real World Haskell [1], the course by Erik Meijer [2] and the courses referenced here [3] worked much better for me. [1] http://book.realworldhaskell.org/ http://book.realworldhaskell.org/ [2] https://www.edx.org/course/introduction-functional-programming-delftx-fp101x https://www.edx.org/course/introduction-functional-programmi... [3] https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell
- cranium 12y agoI like Haskell for the same reasons I like VIM: - It needs some brain melting to learn but it ultimately makes you a better coder. Time is not wasted on learning it. - A new exciting mindset ! - When you feel you're doing something repetitive, it's nearly sure there is a way to do it effortless. - Advanced stuff
- leereeves 12y agoI really like this book, but I think it may be teaching some bad habits by ignoring performance concerns.
- AnimalMuppet 12y agoIt's not a problem until it's a problem. That is: At least 90% of code is not CPU-limited. It's fast enough. So, as an initial approach, ignoring performance is fine. The problem is that, if and when you run into real performance issues, you need to know some tools for dealing with them. If this book doesn't teach you those, well... it's a language introduction. It's not an advanced text. Maybe it would be the better for a warning or two, a paragraph here or there, but performance is (quite properly) not the point for the book.
- leereeves 12y agoFair enough. I guess I mean to say that I really like this book, and would enjoy more from the author teaching fast Haskell, to supplement this book about simple Haskell.
- titanomachy 12y agoI was pleasantly surprised recently when I noticed that this book has a discussion of efficient list construction [1]. I know it's a fairly basic idea, but the author brings it up purely for performance reasons. Given the introductory nature of this book I didn't expect that. [1]: http://learnyouahaskell.com/for-a-few-monads-more http://learnyouahaskell.com/for-a-few-monads-more
- quadrangle 12y agoI suggest the Haskell Wikibook as the best overall intro to Haskell actually: http://en.wikibooks.org/wiki/Haskell http://en.wikibooks.org/wiki/Haskell (and you can make it better if you find anything to complain about! but seriously, it's superb)