Home

Awesome

Functional Design and Architecture

It is a fundamental book about Software Design in statically typed functional languages, such as Haskell, F#, OCaml, PureScript, Elm, Scala. The main idea of this book is to provide a comprehensive source of knowledge, and a complete methodology for building real-world applications with functional ideas and patterns.

<p float="left"> <a href="https://www.manning.com/books/functional-design-and-architecture"> <img src="https://github.com/graninas/Functional-Design-and-Architecture/blob/91ace7d9a3756d0472fa8b046eb345a176914a84/Manning-Publications/FDaA%20Manning%20cover.png" width="200"></a> <a href="https://leanpub.com/functional-design-and-architecture"> <img src="https://github.com/graninas/functional-declarative-design-methodology/blob/9942840a5cb11c8844afa452a579031548d16225/images/FDaA_FE_cover.png" width="200"></a> </p>

Topics

Additional materials

Functional Declarative Design (FDD) Methodology

This article introduces Functional Declarative Design (FDD), a counterpart to Object-Oriented Design (OOD).

Functional Declarative Design: A Comprehensive Methodology for Statically-Typed Functional Programming Languages

Automatic White-Box Testing with Free Monads (article and showcase)

This is a showcase project demonstrating an approach to white-box testing. I've developed this approach for Juspay. It has its place in the Presto.Backend and EulerHS frameworks. The approach can be used for regression testing and not only.

The idea is that Free monadic scenarios can be recorded into a JSON file (recording) which can then be replayed against a new version of the code. Recordings represent a full footprint of a scenario and thus replaying it will immediately spot changes and bugs.

Automatic White-Box Testing Showcase

Accompanying projects

The Andromeda project

This is the first project created specially for the book. It demonstrates the ideas from the book in a standalone application simulating a SCADA system for spaceships.

Andromeda SCADA-like system

The Hydra project

The Hydra project is the second project created for the book. It's an application framework for building multithreaded and concurrent applications in Haskell using the approaches and patterns from the book. The project has three different engines: Final Tagless, Free Monad, and Church Encoded Free Monad, - and you can see the differences between these approaches by checking the different implementations of the same application.

Real-world applications of the ideas from the book

Juspay's Haskell EulerHS framework

This is a modern, full-fledged Free monad-based Haskell framework for building web backends and console applications built by my team. EulerHS is an "older brother" of the Hydra framework and also is based on my ideas from the book. EulerHS is a default option for all the new projects at the financial company Juspay (Bangalore, India).

EulerHS

Juspay's PureScript frameworks

Before EulerHS, we have created two other Free monadic frameworks:

The Presto.Core framework is used for building mobile apps. It was the first Free monadic framework I designed for Juspay using my ideas (with the participation of other people).

Presto.Backend is intended for building web backends. It derives the design of components directly from Presto.Core. Presto.Backend was by my teammates, not me; although I've designed a recording-replying mechanism for white-box testing and improved the framework in various places.

Juspay's PureScript workflows engine

Another project I was working on with some other great Indian developers was about distributed persistable resumable and typed workflows, in PureScript, Node.JS, and RabbitMQ. This project is not published yet, but it is also based on the Free Monad architecture. Persistency of workflows and the ability to pause them at any time is achieved due to special interpreters utilizing the RecorderT transformer.

Node project

The Node is the most advanced production code in Haskell based on the ideas of this book.

The Node Framework makes the building of distributed applications simple. It allows handling concurrent state (with STM), working with the KV database, host TCP, UDP, and JSON-RPC servers, writing network clients, interactive CLIs, and more. The code of the nodes will be testable, safe, and well-maintainable.

This framework can be a reasonable replacement for Cloud Haskell. I've written a detailed post about framework usage and architecture:

Building network actors with Node Framework

References list

References List