TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Learn You a Haskell for Great Good

135 pointsby msvanabout 12 years ago

12 comments

tieTYTabout 12 years ago
This is an amazing book. I highly recommend it as the first Haskell book you read. After it, you can check out Real World Haskell.<p>To elaborate on why you shouldn't read (at least the online version of) Real World Haskell first: It has a lot of important topics that it covers that LYAH does not cover (like how to use cabal their package manager). But, it's not as good of a tutorial on the language and functional programming. It glosses over very complex topics, goes into a lot of depth on details that are not so important and worst of all, gives you some exercises that you aren't capable of answering yet. I tried learning Haskell three times from that book and gave up because it just killed my confidence.<p>Then I discovered LYAH. It explains things very simply and at a very good pace. If you want to learn Haskell and/or functional programming, I can't recommend it more. Imagine one of the Head First books without all the corny. The only thing I wish it had was exercises.
评论 #5689446 未加载
评论 #5689702 未加载
rhizome31about 12 years ago
What I find confusing with Haskell is that the keywords don't seem to be consistent with the concepts they're meant to express. As someone new to Haskell I learnt that the `class` keyword doesn't express the object-oriented concept of class, but the concept of type class, which is different. Fair enough. What about declaring types then? That must be `type`, right? Nope, `type` is for creating type aliases. OK, surely that must be `newtype` then? Wrong again, `newtype` is also for declaring aliases. All right, to declare a new type, you don't use `newtype` nor `type` you use `data`. But be careful, the part that has the `data` keyword is still called a type constructor, whereas the part that does not have the `data` keyword is called a data constructor.<p>OK so let's recap, you create a new type with `data`, which is formed of a type constructor that starts with the keyword `data` and a data constructor which doesn't start with `data`. To create aliases you use `type` and `newtype` and to create type classes you use `class`.<p>Now how do you call the type class of things that can be mapped over? Surely that must be something like `mappable`?
评论 #5689991 未加载
ikkyuabout 12 years ago
Haskell looks very interesting but I can't help but ask 'why do I need it?'. Currently I am learning Java since I want to get a jr.developer job later on and Ruby for some scripting and personal projects(maybe even Rails later). So Java is used in industry, Ruby is used in web and metasploit/ronin (something that I like to mess with), but what about Haskell? I am genuinely curious what Haskell can offer. I always see it mentioned on Reddit but I have yet to come across any notable project written with it. Could somebody with experience give me some reasons for me to learn it?
评论 #5689603 未加载
评论 #5689561 未加载
评论 #5689412 未加载
评论 #5689491 未加载
评论 #5689745 未加载
评论 #5689527 未加载
评论 #5689374 未加载
评论 #5689473 未加载
评论 #5691009 未加载
misframerabout 12 years ago
Also useful:<p>Introduction to Haskell lecture slides - <a href="http://shuklan.com/haskell/" rel="nofollow">http://shuklan.com/haskell/</a><p>Real World Haskell - <a href="http://book.realworldhaskell.org/" rel="nofollow">http://book.realworldhaskell.org/</a>
gtaniabout 12 years ago
I think there's a dozen or so free haskell books:<p><a href="http://www.reddit.com/r/haskell/comments/1af3iw/9_best_free_haskell_books/" rel="nofollow">http://www.reddit.com/r/haskell/comments/1af3iw/9_best_free_...</a><p><a href="http://www.linuxlinks.com/article/20130316105209238/BestFreeHaskellBooks.html" rel="nofollow">http://www.linuxlinks.com/article/20130316105209238/BestFree...</a>
ilakshabout 12 years ago
Anyone interested in functional programming might also be interested in LiveScript <a href="http://livescript.net/" rel="nofollow">http://livescript.net/</a>
jamesbrittabout 12 years ago
Good book. Previous discussion on HN:<p><a href="https://news.ycombinator.com/item?id=535675" rel="nofollow">https://news.ycombinator.com/item?id=535675</a><p><a href="https://news.ycombinator.com/item?id=336085" rel="nofollow">https://news.ycombinator.com/item?id=336085</a>
platzabout 12 years ago
I'll reccomend Erik Meijer's videos on introductory Haskell. I haven't gotten though them all but I appreciate his style and depth of knowledge on the matter; he also points out many things that a Java or C# dev would naturally be curious about how to interpret Haskell.<p><a href="http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Functional-Programming-Fundamentals/Lecture-Series-Erik-Meijer-Functional-Programming-Fundamentals-Chapter-1" rel="nofollow">http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Func...</a>
6d0debc071about 12 years ago
I didn't like LYaHfGG.<p>Take this in p52 for instance:<p>maximum' :: (Ord a) =&#62; [a] -&#62; a<p>maximum' [] = error "Maximum of empty list!"<p>maximum' [x] = x<p>maximum' (x:xs) = max x (maximum xs)<p>Now, you may think that implies that you could do something like this to print a string one character at a time:<p>rsoat (x:xs) = show x (rsoat xs)<p>Buy you can't. If you try that Haskell complains "The function 'show' is applied to two arguments, but its type 'a0 -&#62; String' has only one...."<p>Fair enough, one might reason - you're just passing max two things when it wants one so we can do something like this:<p>rsoat [] = []<p>rsoat [x] = show x<p>rsoat (x:xs) = rsoat xs<p>But no, that just gets you the tail of your string because x:xs doesn't match x so it never prints the other bits.<p>What you may end up doing is something like this:<p>rsoat [] = []<p>rsoat [x] = [x]<p>rsoat (x:xs) = show x ++ (rsoat xs)<p>But that's still not really doing what you wanted to do in the first place. It's sticking all your characters into a string and then reading that string all at once. And it's not a particularly obvious solution either if you don't know the language.<p>This may seem a silly example. But what happens when, as is frequently the case, someone wants to retrieve the nth element of a list? (list !! n) Haskell, as learnt through Learn You a Haskell, can easily be expected to drive someone up the wall who starts asking such questions - it's not a whole bunch of fun to play with.
评论 #5690354 未加载
评论 #5690405 未加载
GhotiFishabout 12 years ago
I really liked LYAH, but it only starts out good. Once you hit Chapter 9. I/O. Prepare to fall off the rails. It only gets worse and worse and worse from that point onwards.<p>I don't think that's really the books fault as much as it is Haskells. I also think it's why you hear ALOT of people swearing Haskell is actually very easy, because everything up to chapter 9 is not very complicated at all.<p>I'm sure there are some very tallented people where this isn't true, but I get the impression that the people who are saying it's easy haven't gotten to the point where you can actually do things with Haskell, or developed a program with Haskell, or inter-operate with other libraries using Haskell, or tested their metal against the Parsing Combinators in Haskell (let alone making your own set), or ect. ect. ect.<p>Chapters 1-8 aren't complicated in the slightest.<p>Chapter 9 is when it starts.<p>Haskell isn't easy.
dchukabout 12 years ago
Is the name of this book some sort of inside joke or something?
评论 #5690011 未加载
评论 #5689523 未加载
评论 #5689429 未加载
评论 #5689486 未加载
评论 #5689409 未加载
hawkwabout 12 years ago
I'm fairly certain I've seen this posted to HN before... good book, though!