• Stars
    star
    466
  • Rank 90,996 (Top 2 %)
  • Language
    Haskell
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Functional Design and Architecture

Code and materials for my book "Functional Design and Architecture" (1st and 2nd editions)

What this book is about?

The book is focusing on these topics:

  • Architecture modeling, requirements analysis, subsystems design from FP point of view;
  • Embedded and external DSLs in domain modeling;
  • 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.

References list

References List

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

N.B. The project is quite outdated. Haskell has changed a lot since then. I'm working on its resurrection currently.

The Hydra project

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.

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 me and 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've 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 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 a various places.

Juspay's 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.

Node project

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

The Node Framework makes building of distributed applications 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

Additional materials

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 be then replayed against a new version of the code. Recordings represent a full footprint of a scenario and thus replaying of it will immediately spot changes and bugs.

Automatic White-Box Testing Showcase

More Repositories

1

software-design-in-haskell

Software Design in Haskell. A structured set of materials. How to build real-world applications in Haskell.
Haskell
1,034
star
2

cpp_functional_programming

List of materials about functional programming in C++
627
star
3

The-Voids-Of-Haskell

241
star
4

functional-declarative-design-methodology

Article: Functional Declarative Design
192
star
5

Hydra

Hydra is a full-fledged framework for building web services, multithreaded and concurrent applications with SQL and KV DB support.
Haskell
176
star
6

hierarchical-free-monads-the-most-developed-approach-in-haskell

Big article about Hierarchical Free Monads, the most developed approach to build real software in Haskell
Haskell
151
star
7

automatic-whitebox-testing-showcase

Automatic white-box testing with Free monads: approach description and showcase
Haskell
82
star
8

Andromeda

Haskell
69
star
9

cpp_stm_free

Composable monadic STM for C++ on Free monads
C++
58
star
10

Pragmatic-Type-Level-Design

Code and materials for my book "Pragmatic Type Level Design"
Haskell
53
star
11

stm-free

STM on Free monads
Haskell
23
star
12

Haskell-Algorithms

Learning Haskell: algorithms, data structures, mini-programs, materials, excercises
HTML
16
star
13

The-Amoeba-World

The Amoeba World game
Haskell
13
star
14

pointed-validation

Validation using pointed getters with error path tracking.
Haskell
13
star
15

GraphServer

GraphServer for Haskell code visualization
Haskell
12
star
16

software-engeneering-python

Python
11
star
17

cpp_lenses

Functional lenses on C++ (highly experimental).
C++
11
star
18

Zeplrog

Experimental Rogue-like Zero Player game in Haskell and gloss
Haskell
10
star
19

cpp_parsec_free

Monadic parsers library
C++
8
star
20

Amber

This is a showcase project of the functional design on C++.
C++
7
star
21

cpp_philosophers_stm

Dining philosophers task using combinatorial STM built on top of Free monad
C++
7
star
22

Adv2Game

Advanced Adventure Game on Haskell
Haskell
7
star
23

hinteractive

Engine for interactive fiction games like Zork.
Haskell
7
star
24

zio-free

Free monadic clone (Haskell ) of Scala's ZIO, experimental
Haskell
5
star
25

Quest-Tutorial-Code

Quest Tutorial Code for Haskell Quest Tutorial articles
Haskell
4
star
26

transition-graph

Transition Graph eDSL
Haskell
4
star
27

cpp_final_tagless

C++
3
star
28

ICFPC2011

Code and Materials for ICFPC2011
Haskell
2
star
29

gt-money

Money library (showcase of type safe approaches)
Haskell
2
star
30

ICFPC2011-Monads

Second code variant using monad State, monad transformer and special data types (incomplete)
Haskell
2
star
31

ICFPC-2012-Hackaton

Repository for attenders of ICFPC-2012 hackaton at Jan 2015, Novosibirsk
Haskell
2
star
32

MetaLife

Haskell
2
star
33

CMLife

Functional Game of Life on C++. Uses functional declarative design and functional idioms (comonads, zippers etc.)
C++
2
star
34

stm-frp

Haskell
2
star
35

haskell-companies

A gently curated list of companies using Haskell in industry
1
star
36

PureScript-Algorithms

Sandbox for PureScript test apps
PureScript
1
star
37

cpp_functional_core

Core library for functional programming on C++ (lenses, monads, etc.)
C++
1
star
38

QST

C++
1
star
39

BigSpace-obsolete

This repository was an attempt to create good project structure on Haskell. Now it is obsolete. (See The-Amoeba-World instead).
Haskell
1
star
40

ICFPC2007

Partial implementation of Endo's morphing - training due to ICFPC 2014 is coming.
Haskell
1
star
41

haskell-exercises

Haskell
1
star
42

BigSpace-Documentation

Design documents, concept art
1
star
43

yellow-stone

Experiments
Haskell
1
star
44

TestEcho

Erlang
1
star