Email the Author

You can use this page to email Alexander Granin about Functional Design and Architecture.

Please include an email address so the author can respond to your query

This message will be sent to Alexander Granin

This site is protected by reCAPTCHA and the Google  Privacy Policy and  Terms of Service apply.

About the Book

It is a fundamental book about Software Design in Haskell. The main idea of this book is to provide a comprehensive source of knowledge, a complete methodology of building real world applications in Haskell. Application architectures, best practices, design patterns and approaches, - all the information you need to achieve a simple, maintainable, testable code with low complexity and low risks. By reading this book, you’ll learn many useful techniques: from the requirement analysis to the implementation of particular subsystems such as SQL and NoSQL databases, multithreading, logging. You’ll learn about design principles, application layers, functional interfaces, Inversion of Control and Dependency Injection in Haskell.

The book has 9 chapters, 780K symbols, 120K words.

There is a printed version of the book. This is how it looks like (video). You can either obtain a light package with the e-book only, or buy a full package offering an e-book copy, educational videos and a paper book. Send me your PurchaseID and shipping address by email, and I'll send you a copy for free.

Paper book is unavailable for now. I'm experiencing big troubles with international shipping. You can find the detailed explanation here. I'll contact to all my buyers who didn't receive their paper copies due to that.

The book is very practical. It will be useful for software engineers who want to improve their software design skills with a strong relation to many advanced Haskell concepts.

The book requires a certain level of Haskell knowledge, up to intermediate.

The book covers a big gap in the Haskell ecosystem: the lack of resources about high-level application design. It’s also important that the ideas from the book were used in real production with great success. The book offers my own methodology - Functional Declarative Design, with Hierarchical Free Monads as a core technology. Using this methodology, I created several real-world frameworks, and they are driving a successful business in several companies.

Book topics:

  • requirements analysis and architecture modeling;
  • application layering;
  • design principles, SOLID;
  • Haskell-specific design patterns;
  • Inversion of Control and Dependency Injection;
  • domain modeling, embedded and external DSLs;
  • functional interfaces, subsystems and services;
  • Free monads, ReaderT pattern, Service handle pattern;
  • Final Tagless/mtl, GADTs
  • multithreading and concurrency;
  • state and stateful applications;
  • design of business logic;
  • interaction with impure subsystems;
  • relational and key-value databases;
  • error handling, exceptions, error domains;
  • web servers, HTTP backends, CLI applications;
  • property-based, functional and integration testing;
  • black box and white box testing.

The book is project-based. There are two showcase projects for it:

  • Hydra, a full-fledged framework for building web services, multithreaded and concurrent applications with SQL and KV DB support. Contains 3 engines: Final Tagless, Free Monad and Church Encoded Free Monad, as well as several demo applications to compare these 3 approaches.
  • Andromeda, a SCADA software for spaceship control.

I designed the following real-world frameworks using the ideas from the book (with the help of other people of course):

  • EulerHS - a Haskell framework for web backends and console apps. Has many subsystems out of the box: SQL DBs support (Postgres, MySQL, SQLite), KV DBs support (Reddis), logging, concurrent flows, exception handling, automatic whitebox testing, typed options and other stuff.
  • PureScript Presto - a PureScript framework for building mobile apps using a handy eDSL.
  • PureScript Presto.Backend - a PureScript framework for web backends. It has the same design as Presto but also is empowered by some additional features like logging, HTTP APIs integration, KV DB, SQL DB subsystems, state handling, automatic whitebox testing, and other useful stuff.

All of these frameworks drive the business of an Indian financial company Juspay. Its mobile apps and financial backends have hundreds of thousands lines of code, and these frameworks are really tested in production. This technology helped the company to grow up and enabled a wide adoption of PureScript and Haskell. Essentially, Juspay was the first company I used my ideas in. We found that Hierarchical Free Monads hide all the complexity of implementation details behind convenient interfaces so that the code is understandable by not only developers but by managers as well. This helped us to easily reason about the domain, the logic, the business goals and requirements. My approach also brought confidence that Haskell and PureScript are not only academic languages.

  • Node - a full-fledged framework for building distributed, concurrent, multithreading apps, blockchains initially, but not only. I designed this framework for Enecuum and then we successfully created our own blockchain using it. What's important, we managed to achieve our goals less than in 4 months with a team of 4 haskellers. The framework allowed us to write fast, complicated blockchain logic easily, quickly, without bugs and with maximum confidence due to a great testability of the HFM approach. You can read more about the framework in this my article: Building network actors with Node Framework.

About the Author

Alexander Granin’s avatar Alexander Granin

@graninas

Instagram

International speaker, researcher, author

Expert Haskell and C++ developer

Software architect, team lead

Haskell consultant

Author of the book "Functional Design and Architecture"

Logo white 96 67 2x

Publish Early, Publish Often

  • Path
  • There are many paths, but the one you're on right now on Leanpub is:
  • Functional-design-and-architecture › Email Author › New
    • READERS
    • Newsletters
    • Weekly Sale
    • Monthly Sale
    • Store
    • Home
    • Redeem a Token
    • Search
    • Support
    • Leanpub FAQ
    • Leanpub Author FAQ
    • Search our Help Center
    • How to Contact Us
    • FRONTMATTER PODCAST
    • Featured Episode
    • Episode List
    • COMPANY
    • About
    • About Leanpub
    • Blog
    • Contact
    • Press
    • Essays
    • Climate Change
    • Simplifying
    • Manifesto
    • COVID-19
    • More
    • Causes
    • Accessibility
    • AUTHORS
    • Write and Publish on Leanpub
    • Create a Book
    • Create a Course
    • Testimonials
    • Why Leanpub
    • Author Newsletter
    • The Leanpub Author Update
    • Author Support
    • Author Help Center
    • Leanpub Authors Forum
    • The Leanpub Manual
    • Supported Languages
    • The LFM Manual
    • Markua Manual
    • Developer Support
    • API Docs
    • Companies
    • Company Program
    • Create a Company
    • Universities
    • Universities Program
    • LEGAL
    • Terms of Service
    • Copyright Policy
    • Privacy Policy

Leanpub is copyright © 2010-2021 Ruboss Technology Corp. All rights reserved.

Leanpub requires cookies in order to provide you the best experience. Dismiss