Haskell Good Reads: From Zero to Hero

I hesitate to mention anything after reading the entire thread, since it is now completely unclear to me what kind of comments are sought by the OP.

  • A real book (though this already appears on the Learning Haskell wiki page): What about Haskell: the craft of functional programming (3rd Ed.) by Simon Thomson (Addison-Wesley, 2011)? A self-contained, though somewhat older, comprehensive-but-far-from-complete introduction to Haskell as a (functional) programming language and how to use it in practice. You may not need more; readable, well-organized (3rd edition). But opinions vary (some find it fun and readable, etc.).

  • As mentioned by others, just reading (books, or anything else) will not be enough and not be very effective. What I found helpful is the IHaskell kernel for use with interactive Jupyter notebooks. No need to create projects, to compile stuff, to scroll back in the invisible history of an interpreter. All your experiments sit together in a single document, with your textual notes (where you can use LaTeX formatting), and immediate hlint feedback. Unfortunately, I don’t know any books that exploit this for Haskell. (I also use these Jupyter notebooks with the IPython, IJava, and (also free) Wolfram Language kernels.)

2 Likes

Hi, I can’t resist to recommending my book “Functional Design and Architecture”. It’s exactly this:

  • Describes a really practical Haskell;
  • Tells you about application architectures, approaches, design patterns, best practices and principles of software development in Haskell;
  • Is backed by the Hydra showcase framework having all the needed subsystems for building web backends and console apps out of the box (SQL DBs, logging, KV DBs, multithreading etc);
  • Is backed by several showcase apps built on top of Hydra;
  • Backed by the real-world technologies I created for several companies using the ideas from the book.

Let me articulate this better: I wrote my book, invented several approaches for building real world apps in Haskell, and then used these ideas in real production. In Juspay, where I’m working currently, we have at least 3 core frameworks I (with other colleagues) created:

  • Haskell EulerHS framework (the older brother of Hydra). We use this framework for our financial backends intensively.
  • PureScript Presto.Core framework. This one is needed for our mobile apps. Also very successful, and in fact the first framework I created for them.
  • PureScript Presto.Backend. This is a fork of the Presto.Core, but for backends. They took the same design and used it for their backend needs. The most of the business logic is written on top of it (hundreds of kilos of LoC).

I and my team also created the Enecuum’s Node framework for distributed apps and blockchains. This allowed us to create a very reliable, highly concurrent and testable blockchain in short terms.

So you can see how much is done, all is due to my book (this is not the exhaustive list even). And just to be clear: no, I’m not only creating frameworks, I’m also developing a lot of business logic, so I know how it is important to have a good code base in terms of code quality, maintainability, simplicity, testability. These are all the topics of my book.

Currently, I’m working on the second edition for Manning Publications. Hope to have it at the end of this year.

And also, I have my second book under development: Pragmatic Type Level Design. Join me to know more!

4 Likes

@graninas Which books did you read which either inspired you the most in writing yours or are those which you wanted to improve upon the most?

@Nycticorax That’s an interesting question!

In 2015, I started looking for materials on how to design big apps in Haskell. I was a C++ / C# / Python developer professionally, and I had a pretty wide ‘mainstream’ background. Haskell was only my hobby. I wanted to read something like Martin Fowler’s “Patterns of Enterprise Application Architecture”, or “Design Patterns” (GoF book), just for Haskell. I was quite sure that there should be some match between how we approach this task in the mainstream and in Haskell, because this knowledge seems to be universal. Testable code, inversion of control, complexity management, layering, design principles such as SRP - all this seems to be applicable to Haskell. But there was none such material. “Real World Haskell” was good, but not quite about this. I was unable to find some material and decided to write my own book (in 2016). Later or, we could have enjoyed by some books happened in this field, for example, “Domain Modeling Made Functional” by Scott Wlaschin. Seems people from other functional languages recognized the problem as well, and started fixing it. There are such books on Scala, I haven’t read them yet. Recently, other haskellers contributed to covering this gap in Haskell, see the book “Production Haskell” by @parsonsmatt . @bravit also touches some questions in his “Haskell in Depth” But I can say it’s not enough. There are lots of things which can be described from the practical point of view.

1 Like

Basic yet very readable tutorial about type-level language pragmas: https://github.com/i-am-tom/haskell-exercises

1 Like

I think you list if great. I wanted to note that what really helped me with Haskell was reading some
non-Haskell books. In particular a book about PLT like TAPL by Benjamin Pierce helped me a great deal.
Idris book is another example (Type Driven Development with Idris (sadly still for version 1 of Idris) is another example of non-Haskell book that is so helpful with Haskell.
Also Bartosz Milewski’s Category Theory For Programmers! - this one is Haskell focused.

2 Likes

More excellent resources here: https://github.com/tweag/awesome-learning-haskell/tree/0f294a34ce5e3ebc0f5f89259b819c1a4ed4c31a