News for hackers. Stuff that matters.
Re:Learn You a Haskell for Great Good by DonaldPShimoda on Tuesday August 21, 2018 @03:51PM (#17813071)
I tried LYAH before I had any real functional experience, and it went poorly. I think I wasn't dedicated enough.

I took a programming languages class taught in Racket, and by the end of that semester I felt like I had finally "gotten" what functional programming was all about.

Tried LYAH again and... it still didn't quite stick. Not sure why. But I was determined, because I'd heard about Haskell so much on the internet.

So I took a follow-up "class" where we just implemented projects in the functional languages of our choice, and I chose to do everything in Haskell. I asked my research advisor (I work in a PL research lab) for guidance, and that's when Haskell really started to make sense for me. I'm not sure why LYAH wasn't good for me, when it's touted as being a great starting place for so many people, but now Haskell is one of my favorite languages by far.

Re:Learn You a Haskell for Great Good by BoiledCabbage on Tuesday August 21, 2018 @04:04PM (#17813220)
> I'm not sure why LYAH wasn't good for me, when it's touted as being a great starting place

It's not. It's a terrible starting resource. Majority of people I anecdotally hear gave up on Haskell seem to mention LYAH. Yes the material is there, but it's not presented in a way that generally sticks and fits pieces together. I guarantee someone will reply to this thread and say it worked for them, but in general people seem to be unsuccessful with it.

There are better options out there.

Re:Learn You a Haskell for Great Good by danieldk on Tuesday August 21, 2018 @04:20PM (#17813396)
I think the enthusiasm for LYAH should also be seen in context.

Real World Haskell was the first book that made it to a wider audience. And while was is full of useful information, it is a very uneven book that works badly as an introduction to Haskell. We once had a reading group where we read RWH, most colleagues dropped out after the first 3-4 chapters.

In comparison, LYAH was a book that was far more straightforward as an introduction. And I know a few people that have gone through it cover to cover.

Although it's been a while since I read it, I really liked Graham Hutton's 'Programming in Haskell'. It was short & clear.

Re:Learn You a Haskell for Great Good by kitd on Wednesday August 22, 2018 @06:47AM (#17817729)
Hutton's book was my favourite too when I was learning Haskell. My only gripe was it used a proper typeface for it's code samples, making mapping to keyboard strokes an unnecessary cognitive effort.
Re:Learn You a Haskell for Great Good by hexane360 on Tuesday August 21, 2018 @08:22PM (#17815081)
>Majority of people I anecdotally hear gave up on Haskell seem to mention LYAH

This is a bad statistic to use on its own. Imagine if I said "Majority of people I anecdotally hear gave up on web development seem to mention HTML". See the problem?

Re:Learn You a Haskell for Great Good by NateEag on Tuesday August 21, 2018 @09:18PM (#17815422)
HTML is by definition intrinsic to Web development.

LYAH is not intrinsic to Haskell programming.

Re:Learn You a Haskell for Great Good by marvy on Tuesday August 21, 2018 @11:59PM (#17816182)
Let me try to make hexane360's point more explicitly:

Imagine a hypothetical universe where all Haskell books are equally good, but some are more popular than others (maybe they have well known authors, or catchy titles, or are available for free online, or something). In particular, imagine Haskell Book Number 7 (HB#7 for short) gets 99% "market share".

Then if someone says "most people who gave up on Haskell used this book", you should not conclude that it reflects badly on the book. It's just a consequence of the book being popular, so it's the one people tend to try to use, so it's "the one that didn't work for them".

If you want to learn whether the book is better or worse than average, you need to split people into two groups: one group used this book, the other group used some other book, and compare which group does better. (Ideally, you should assign people to a group based on a coin flip, but even just looking at what happens "naturally" without your interference is better than nothing.)

Back to our non-hypothetical universe: LYAH does not have 99% market share, but it's pretty popular. I heard of it, and I've never looked for a book on Haskell. So to some extent the same logic applies.

Re:Learn You a Haskell for Great Good by NateEag on Thursday August 23, 2018 @08:53PM (#17831927)
I see what you're saying, and it makes some sense.

As you say, though, LYAH is almost certainly not at 99% market share. It's definitely not at the 100% market share HTML has in Web development.

The universe is too complex to design a statistically-valid study for everything you want to know (though I definitely understand the urge to do that). At the end of the day, anecdotal evidence may not be great, but it's often better than nothing, and nothing is often the only other practical option.

Re:Learn You a Haskell for Great Good by marvy on Thursday August 23, 2018 @10:02PM (#17832218)
> better than nothing, [which is sometimes the only other option]

True. The trick is to sort of mentally keep track of how much better than nothing it is, so you know which pieces of anecdotal evidence you can trust with only 40% confidence, and which you can trust with something more like 90%.

But yeah, definitely WAY better than nothing.

Re:Learn You a Haskell for Great Good by FearNotDaniel on Friday August 24, 2018 @11:41AM (#17835608)
I had a very similar experience with the "Poignant Guide To Ruby" back in the day. It had an enormous cult following, it's a charming piece of programming-themed art, and probably did a lot to encourage people to want to learn the language, but I found it wasn't actually very practical as a tool for learning.
Re:Learn You a Haskell for Great Good by neon_electro on Tuesday August 21, 2018 @04:07PM (#17813250)
What would you recommend?
Re:Learn You a Haskell for Great Good by js8 on Wednesday August 22, 2018 @05:11AM (#17817376)
I would start with Haskell Programming from first principles, as it is recommended by many and it looks good (I have to admit I started with LYAH but content-wise, HPFFP is much better).

I also recommend reading these web documents as a supplement:

http://dev.stephendiehl.com/hask/

https://wiki.haskell.org/All_About_Monads

https://wiki.haskell.org/Typeclassopedia

https://www.fpcomplete.com/blog/2017/09/all-about-strictness

I am now reading Haskell High Performance Programming (https://www.packtpub.com/application-development/haskell-hig...), and while the book is more intermediate (it assumes that you can find the documentation and read the Haskell code yourself), I think it is a good overview of how to use modern Haskell in real projects.

Re:Learn You a Haskell for Great Good by almostdeadguy on Tuesday August 21, 2018 @09:00PM (#17815318)
Easily the best one IMO: http://haskellbook.com/ . Unlike LYAH it covers stuff that is actually important to writing real haskell programs like testing code, managing effects via monad transformers, etc.

Also this is one of the best references while you're learning (not good as a tutorial, but chock full of invaluable resources): http://dev.stephendiehl.com/hask/ . TBH I wish every language had an equivalent of this guide.

Re:Learn You a Haskell for Great Good by djur on Tuesday August 21, 2018 @09:00PM (#17815323)
Haskell Programming From First Principles is costly but extremely good: http://haskellbook.com/

The beginner material in the Haskell WikiBook is pretty solid: https://en.wikibooks.org/wiki/Haskell

Re:Learn You a Haskell for Great Good by undseg on Tuesday August 21, 2018 @04:48PM (#17813661)
found this[1] to be a great introductory course. Might want to have dipped into functional concepts beforehand, though.

Fairly sure it was recommended in here in the past and that's how I came to know it, can't give credit because I sadly don't remember.

[1]https://www.seas.upenn.edu/~cis194/spring13/lectures.html

Re:Learn You a Haskell for Great Good by wmfiv on Tuesday August 21, 2018 @04:45PM (#17813628)
Another entry in the not Haskell category, Functional Programming in Scala is outstanding.
Re:Learn You a Haskell for Great Good by sulam on Tuesday August 21, 2018 @05:04PM (#17813810)
Yes, this book is one I recommend to anyone who wants to really understand functional programming. Admittedly it's not Haskell, but it's the book I wished I'd had back when I first learn FP (and Scala).
Re:Learn You a Haskell for Great Good by ChristianGeek on Tuesday August 21, 2018 @08:25PM (#17815100)
It lost me about 2/3 in when it got to monads.
Re:Learn You a Haskell for Great Good by acjohnson55 on Tuesday August 21, 2018 @11:37PM (#17816102)
That's OK. You've already learned more than enough. My life in Scala was just fine once I understood that a monad was just a data type that admitted a flatmap operation.
Re:Learn You a Haskell for Great Good by naraic0o on Tuesday August 21, 2018 @04:26PM (#17813442)
the spring 2013 edition of cis194[0] seems to be the most commonly recommended from previous threads here. due to its popularity a quick web search leads to a lot of secondary learning resources if you get stuck. i'm currently most of the way through it and it's been well presented and nicely challenging.

[0]http://www.cis.upenn.edu/~cis194/spring13/lectures.html

Re:Learn You a Haskell for Great Good by nilkn on Tuesday August 21, 2018 @11:33PM (#17816090)
I learned Haskell from the "Gentle Introduction" (which isn't so gentle), then writing programs, reading documentation, and reading online discussions and threads.

https://www.haskell.org/tutorial/

Re:Learn You a Haskell for Great Good by dvlsg on Tuesday August 21, 2018 @04:15PM (#17813348)
I'm not OP and it's not haskell, but fsharpforfunandprofit.com really clicked for me, personally.
Re:Learn You a Haskell for Great Good by acjohnson55 on Tuesday August 21, 2018 @11:38PM (#17816110)
Real World OCaml is great.

While not purely functional, I also recommend JacaScript Allongé.

Both are free online!

Re:Learn You a Haskell for Great Good by ghayes on Tuesday August 21, 2018 @04:22PM (#17813415)
I really enjoyed programming in Elm as a starting point. Elm avoids type-classes, which tend to be the biggest hurdle when starting to learn Haskell. Plus, you can design a nice web app in the process (versus, say, process CSV files). After I became comfortable with Elm, learning Haskell, type-classes, lazy evaluation, etc., made significantly more sense to me. For instance, `do` syntax is great, but it's not obvious what it really is doing, at first, unless you've programmed pure functional languages without using `do`.

Also, learning Idris is another great learning exercise if you want to stretch the ways to think about programming.

Re:Learn You a Haskell for Great Good by bor0 on Tuesday August 21, 2018 @06:11PM (#17814288)
Learning Idris will definitely alter the way you think about programming and make you a better programmer, even if you don't program in it on a daily basis.
Re:Learn You a Haskell for Great Good by zadler on Tuesday August 21, 2018 @11:36PM (#17816097)
Can you give a little more info? Does it offer alot over Haskell?
Re:Learn You a Haskell for Great Good by andrzejsz on Wednesday August 22, 2018 @04:59AM (#17817336)
Dependent types
Re:Learn You a Haskell for Great Good by sevensor on Tuesday August 21, 2018 @04:08PM (#17813265)
I've bounced off LYAH more than once because it spends so much time in the REPL. I'm not interested in the REPL as an end in itself, only insofar as it can help me develop an actual program. Outside of image-based environments, what you do in the interactive shell doesn't reflect how actual code gets written. It feels trivial, and it doesn't help you build up a library of examples to refer back to later.
Re:Learn You a Haskell for Great Good by 3rdAccount on Tuesday August 21, 2018 @06:10PM (#17814283)
This bothered me too. I use a REPL everyday, but you have to know how to write full programs too.
Re:Learn You a Haskell for Great Good by fjsolwmv on Tuesday August 21, 2018 @09:21PM (#17815433)
What book on any language shows you whole programs that couldn't be seen in repl (assuming a repl exists)
Re:Learn You a Haskell for Great Good by sevensor on Tuesday August 21, 2018 @11:04PM (#17815950)
Off the top of my head, HtDP, despite being entirely presented within DrRacket, has you work through programs that you could just as well compile. Learn Python the Hard Way, as well as every other "Hard Way" book, makes a point of having you write entire programs. The Ocaml resource that was posted a week or two ago makes a point of deemphasizing the REPL.
Re:Learn You a Haskell for Great Good by 3rdAccount on Thursday August 23, 2018 @06:43AM (#17826096)
I have over 25 programming books in my cube and another dozen or so at home. I'd say roughly 1/3 tend to favor full practical programs interlaced with snippets. The full programs are usually 1/2 to a few pages in each chapter and are in general, not something I'd try to cram into the REPL piece by piece.
Re:Learn You a Haskell for Great Good by tirumaraiselvan on Wednesday August 22, 2018 @01:19AM (#17816491)
I concur. LYAH may be seen as an intuitive and easy read for getting started but I felt I was incapable of understanding real Haskell code with just that background. I finally got my hands dirty by hacking around on existing Haskell code which is when things started making sense.
Re:Learn You a Haskell for Great Good by jSherz on Tuesday August 21, 2018 @04:15PM (#17813345)
Are there any similar resources with practical examples (other than the book Real World Haskell)?