Giter Club home page Giter Club logo

functional-design-and-architecture's Introduction

Functional Design and Architecture

Code and materials for my book "Functional Design and Architecture"

N.B. I'm currently working on the second book, Pragmatic Type Level Design. Your support will be highly appreciated!

What this book is about?

The book is focusing on these topics:

  • Architecture modelling, requirements analysis, subsystems design from FP point of view;
  • Embedded and external DSLs in domain modelling;
  • Monads as subsystems with effects;
  • Free monads as functional interfaces;
  • Other types of functional interfaces;
  • Inversion of Control in FP (using Free monadic eDSLs);
  • Applicability of mainstream techniques and approaches such as UML, SOLID, GRASP;
  • Interaction with impure subsystems.

Additional materials

References list

References List

Andromeda

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

Hydra

The Hydra project is the second project created for the book. It's a framework similar to the Node framework for building multithreaded and concurrent applications in Haskell using the approaches and patterns from the book. It's interesting that 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.

Node project

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

The Node Framework makes building of network acting nodes simple. It allows to handle concurrent state (with STM), work with KV database, host TCP, UDP and JSON-RPC servers, write network clients, interactible 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 wrote a detailed post about framework usage and architecture:

Building network actors with Node Framework

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 and then ported it to Haskell (with help of other folks). The approach can be used for regression testing.

In it, Free Monadic scenarios can be recorded into a JSON recording which can be replayed against a new version of the code. A recording is a full footprint of a scenario and thus replaing of it will immediately spot changes and bugs.

Automatic White-Box Testing Showcase

Juspay PureScript Presto Framework

I also was working for Juspay (India, Bangalore). In there, we have created two big projects in PureScript with the same central ideas of Free monads and architecture. The Presto framework for building mobile apps was published. The most of code (including Free eDSL and runtime) is designed and written by me:

PureScript Presto

Juspay PureScript Presto.Backend Framework

This is the second Free Monad framework. It resembles the Presto Framework and basically borrows its architecture. This framework is made by my colleauges, not me; although I've designed a recording-replying mechanism for white-box testing.

PureScript Presto.Backend

Juspay PureScript Workflows Engine

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

functional-design-and-architecture's People

Contributors

graninas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.