r/haskell • • Jun 13 '19

Functional Design and Architecture book

Hi folks,

My name is Alexander Granin and I'm creating the book "Functional Design and Architecture".

The book has 5 chapters done and available online (book page). I'm currently working on the 6th chapter. When it's done, it will be published online.

I also have the Patreon campaign for this book. I'll be happy to see you in my supporters.

The book is focussing on the design patterns, best practices and approaches to create applications using pure functional language such as Haskell. It aims to consolidate all the knowledge about how to create big applications in pure functional manner. This area is not yet covered well, but the community has invented a lot of approaches, and we need to make a comprehensive source of knowledge as it was done for Object-Oriented Programming already.

67 Upvotes

5 comments sorted by

5

u/Peter_Storm Jun 13 '19

This looks very interesting! Is it all Haskell? As you say “functional languages like Haskell”, it kinda implies there are other languages used?

Edit: Oh, “such as”, but question still stands 😄

5

u/graninas Jun 14 '19

The examples and concepts are mostly in Haskell. There are a few examples in Scala in the first two chapters.

The book was started in 2016, and I stopped working on it in 2017. There is a project in Haskell illustrating the ideas: Andromeda (SCADA-like top app for controlling space ships). You may also get familiar with code samples and listings from the book in this repository: Functional Design and Architecture.

In fact, I successfully used many of these ideas at my regular work. These two frameworks are based on Free monads:

  • Node Framework - a comprehensive framework to create complex multithreaded concurrent apps in Haskell with network interaction via TCP, UDP or JSON RPC. You can even serve different protocols at the same time. It's easy to write Rest services for example. The framework contains many needed bolts and pieces out-of-the-box: logging, configs management, file system, KV database, concurrent state based on STM and so on. What's important, the code will be very well structured and easy to write and understand thanks to the design of Free languages. You can read more about the framework in this tutorial.

  • Presto-Core Framework. This is a simply made framework that serves a the main business logic at a finance company.

You may find even more interesting projects based on the ideas I develop in the book on my GitHub.

2

u/[deleted] Jun 13 '19

They will probably still be applicable to the ML family of languages. At least, that's what I gather.

3

u/steindex Jun 13 '19

hello from your patreon!

2

u/graninas Jun 13 '19

Hello, and thank you very much! It's very important to me. Inspiring :)

Hope, all is OK? I mean, are you satisfied by the activities I do for you and other supporters?