Live data from Hacker News

Learn You a Haskell for Great Good

learnyouahaskell.com

131–140 of 152 posts

Re: Learn You a Haskell for Great Good

#131
It seems obvious to me that LYAH is an imitation of Why's Poignant Guide to Ruby, and that neither is actually a good learning resource. I don't mean to disparage these as works of art, but _why did it first, _why did it better, and if you actually want to learn either ruby or haskell neither should be your first stop.

Re: Learn You a Haskell for Great Good

#132
post #46

LYAH was my first taste of functional programming. Before that I only had 2-3 years of experience using PHP and Ruby. I read this book and quickly fell in love with FP and category theory, for the first time really started to enjoy programming to the fullest. This book is also the reason I was able to land a job as an Erlang developer, and teach a little bit of Haskell to others. Now, 5 years later, I continue my stu…

> to me it holds a lot of emotional value

For me too. I had some experience of FP and was also a PHP programmer. It's one of the funniest programming books I've ever read, references to Avril Lavigne amongst category theory appeals to my sort, but clearly it's not a book for everyone.

So I found it fun to learn and the concept of Applicative Functors in between Monoids and Monads has stuck. As well as the examples of monads, such as walking on a tight rope with birds landing either side.

I'm still not doing pure FP and so I forget much of the content, but its a pleasure to pick up and re-read.

Re: Learn You a Haskell for Great Good

#133

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 intern…

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

#134
LYAH also didn't do much for me.

I got started with Haskell Data Analysis Cookbook. As an experienced programmer, I LOVE the "cookbook" format. E.g., "Keeping and representing data from a CSV file" or "Examining a JSON file with the aeson package". If you need to actually USE the language, this is a great way to get started. Complete programs are shown.

Unfortunately, most books dive into the language _implementation_ instead of teaching its _interface_. (This probably points to a Haskell design weakness: deep learning of the impl. is nec. for success.)

But my REAL wish: Because I'm like many people and have experience with dozens of languages. I want books that leverage that knowledge and experience. E.g., to explain monads, just say it's an interface specification, and give the API. It'll make sense to me.

Re: Learn You a Haskell for Great Good

#135
post #86

I won't comment the book. But my personal feeling is that you need a working environment first. And for that, you need to follow the advice at this resource: https://medium.com/@dogwith1eye/setting-up-haskell-in-vs-cod... with my comment (cf Olivier Rossel). If you are under Ubuntu, forget about the brew paragraph. Just curl -sSL https://get.haskellstack.org/ | sh After all that, you will have an editor that can run/…

I will quote (what i think is) an important part of the learning process: "Much of the difficulty in learning a new language is simply setting up the environment and getting comfortable with the tools to start programming." Having a kind of IDE to play around was immenselly useful in my case. I then could try to solve small problem i invented. And used the various Haskell resources in a non-linear way (how to do this? Cf SO, books, articles, etc. And then some theory articles to tell you why it is done this way. And that again for another topic required to solve my problem, and again, and again). Problem solving was my way to go to discover the Haskell way. Not just reading a book linearly.

Re: Learn You a Haskell for Great Good

#136

LYAH also didn't do much for me. I got started with Haskell Data Analysis Cookbook. As an experienced programmer, I LOVE the "cookbook" format. E.g., "Keeping and representing data from a CSV file" or "Examining a JSON file with the aeson package". If you need to actually USE the language, this is a great way to get started. Complete programs are shown. Unfortunately, most books dive into the language _implementation…

[deleted]

Re: Learn You a Haskell for Great Good

#137
post #50

Haskell is hard, mainly because it's normally not a first language, and the first language people learn probably has Algol-like syntax (e.g. C, Java). I think Erlang is a bit easier to learn due to having fewer features, and for me was the gateway drug to Haskell. It let me learn to program with recursion instead of loops, and pattern matching instead of `if`s. The type system is the best part of Haskell, but unfortu…

I wouldn't really consider stack to be a great tool. There is Stackage which may be useful but the tool itself falls apart quickly when used to compile more than a single package executable.

That being said, one should have looked at these:

  - cabal Nix-style builds
  - ghicd for continuous type-checking
  - stylish-haskell for light code formatting
  - brittany for slightly more invasive code formatting
  - hlint for linting

Re: Learn You a Haskell for Great Good

#138

LYAH also didn't do much for me. I got started with Haskell Data Analysis Cookbook. As an experienced programmer, I LOVE the "cookbook" format. E.g., "Keeping and representing data from a CSV file" or "Examining a JSON file with the aeson package". If you need to actually USE the language, this is a great way to get started. Complete programs are shown. Unfortunately, most books dive into the language _implementation…

> But my REAL wish: Because I'm like many people and have experience with dozens of languages. I want books that leverage that knowledge and experience. E.g., to explain monads, just say it's an interface specification, and give the API. It'll make sense to me.

I understand the wish but I personally believe it is a bad idea. I think Haskell is just too different due to purity and laziness and trying to adapt your intuitions from imperative programming is going to mostly fail, badly. I suggest it's better to approach Haskell with a completely blank mind and learn the correct intuitions through just being very rigorous at the beginning.

I have written a bit of Haskell myself but I still get surprised by evaluation order, for example. But it has paid off, I think, it's a lot more understandable and modular and beautiful code that I write in Haskell than elsewhere.

Re: Learn You a Haskell for Great Good

#139
post #78

Earlier quoted context omitted.

I read more than half of this book, and sadly I did not enjoy it at all. Read it only if you enjoy long-winded verbose explanations. Hutton's or Bird's is concise yet explanatory.

Does the verbosity interfere or can you skip over details you don't need?

Well, if you are reading the chapter, it's because you want to understand it. Since everything in this book is verbose, you can't just skip the verbose parts.

Half the examples contain jokes or cutesy animal sounds (onomatopoeia). I like jokes, but it is distracting me. Especially when I don't understand the cultural reference.

My biggest gripe with the book is that the examples can feel quite contrived. Its probably super hard to make a book featuring all concepts without having contrived examples. But I remember reading a chapter and some arbitrary abstraction is introduced. Problem is, based on that example, I don't realize when the abstraction is useful.

It might be impossible to write a Haskell book that is neither terse not unnecessarily verbose.

Since you can get some chapters for free, I'd recommend you just download them and see if you like the style.

Re: Learn You a Haskell for Great Good

#140
post #125
post #76

Earlier quoted context omitted.

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.

Can you give a little more info? Does it offer alot over Haskell?

Dependent types
Post reply on HN