Functional Design and Architecture (book)

Hello, my name is Alexander Granin, and this is the official page of my book
«Functional Design and Architecture».

What this book is about?

The book is focusing 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.

The draft of book is published online. You’ll find links here. Buy this book, and you’ll get access to the complete edition (once it’s done) along with additional learning materials (6+ educational videos).

Buy «Functional Design and Architecture» on Leanpub


  • Architecture modelling, requirements analysis, subsystems design from the FP point of view
  • Layering
  • Embedded and external DSLs and domain modelling
  • Subsystems and services
  • Free Monads as functional interfaces
  • Other types of functional interfaces: Final Tagless, ReaderT pattern, Service Handle Pattern, GADTs
  • Hierarchical Free Monads as a basis for effects
  • Frameworks
  • Inversion of Control and Dependency Injection in FP
  • Applicability of the mainstream techniques and principles such as UML, SOLID, GRASP
  • Interaction with impure subsystems
  • Project structuring
  • Incorporation of SQL DBs, KV DBs
  • Design of business logic
  • Design of web services and console applications
  • And many other high-level topics


Related projects and materials

The «FDaA» book is project-based. Actually, 2-projects-based at the moment.

  • Andromeda

    A SCADA-like application and simulator for star ships controlling. The first 5 chapters of the book describe the architecture and design of this project.
  • Hydra

    A full-fledged Free Monadic framework to build web services and console applications in Haskell. Supports various SQL DBs, KV DBs, logging, state, multithreading etc. It also provides several demo applications and testing facilities. Hydra has 3 different engines based on Final Tagless, Hierarchical Free Monads and Hierarchical Church Free Monads to provide a common basis for comparison of these approaches.

There are several real-world projects based on the ideas from the book:

  • Node, a real-world all-in-one framework which is tested in production. It allows to build network actors and blockchain protocols, console applications, work with KV database and cryptography. Sample but not simple blockchain applications are also provided there.
  • PureScript Presto — a framework for building mobile apps using a handy eDSL.
  • PureScript Presto.Backend — a framework for web RESTful backends.

My articles about Hierarchical Free Monads:

I’m also giving talks on this topic.


I’m very thankful to all the community and people who gave the light to this project.

  • My wife 🙂
  • Manning Publications: editors, correctors, managers and other people related to the project. They did a lot of work over the first five chapters of the book.
  • Reviewers and readers who made a lot of suggestions how to improve the book.
  • All my Patrons and supporters:
    • Imran Settuba
    • Vasiliy Yorkin
    • Andrei Dziahel
    • Ivan Zemlyachenko
    • Yuriy Syrovetskiy
    • Pavel Dmytriiev
    • Anatolii Prylutskyi
    • Alessandro Pezzato
    • Олег Дмитриенко
    • Sergey Kintsel
    • Mikhail Gaidamaka
    • Tim
    • Vladimir Krivopalov
    • James Bartholomew
    • Fabian
    • Steven Paul Leiva
    • Mikhail Shustov
    • eb31b2cmikqbvcq8
    • Simon Bosse
    • Alexey Lebedeff
    • Vimal Kumar
    • Gabriele Lana
    • Adil
    • ekim boran danişger
    • Eduardo Moritz Cavalcanti
    • Andrei Orlov
    • Artur Yushchenko
    • SleepingCat
    • Anton Selyanin
    • Reynaldo Cordero
    • Alexander Kucherenko
    • Ashutosh Das
    • Dorzhi Tarbaev
    • Igal Tabachnik
    • Maxim Yaskevich
    • Ilia Rodionov
    • Angel Vanegas
    • Evgeny Lyutikov
    • Vadim Sotnikov
    • Sergey Homa
    • Allan Lukwago
    • Hécate
    • James Fielder
    • C++ User Group, Russia
    • Yaroslav Voloshchuk
    • Bogicevic Sasa
    • Vasily Gorev
    • Victor Savkov
    • Julian Wilke
    • Robert Gubin
    • Артем Миклушов
    • Olaf
    • Yuriy Pitometsu
    • Eugen Wissner
    • Tyler Weir
    • Grammarly
    • Jon Fast
    • Henry Laxen
    • Sandy Maguire
    • John Walker
    • erc
    • pluton
    • Evgeny Pogrebnyak
    • Donald Johnson
    • Mathew Fournier
    • Aleksey Sazonov
    • Alex Morgun
    • Nikita Puzankov
    • Christopher Miller
    • Innocent Ndubuisi-Obi Jr
    • Florian Pieper
    • Ivan Tester
    • Andrey Shinkevich
    • Daniel Gräber
    • Eugene Tulushev
    • Jonathan Thaler
    • Dmitriy Zakomirnyi
    • Swanand Kriyaban
    • Andrii Sergiienko
    • Sean
    • rohit
    • Imre Gulyas
    • Enzo Luis Strongoli
    • Ian
    • Martin Frické
    • John Man
    • Martin Allard
    • Mefire Omar
    • Matt Braun
    • Patryk Zieliński
    • Simon Shine
    • Cezar Halmagean
    • Anand Haridas
    • Brian Lane
    • Vitalii Skakun
    • Rui Morais
    • Francesco Zanini
    • Samael