liveBook · Manning

What you will learn in Functional Design and Architecture: Examples in Haskell

Examples in Haskell

by Alexander Granin

Chapter by chapter

Chapter 1: What is software design?

1.1 Why functional programming? · 1.2 Software design · 1.2.1 Requirements, goals, and simplicity · 1.3 Essential and accidental complexity · 1.3.1 Low coupling, high cohesion · 1.3.2 Interfaces, inversion of control, and modularity · 1.3.3 Functional design · 1.4 Design in mainstream paradigms · 1.4.1 Imperative design · 1.4.2 Object-oriented design · 1.4.3 Object-oriented design principles · 1.5 Software design in functional languages · 1.5.1 Immutability, purity, and determinism · 1.5.2 Strong static type systems · 1.5.3 Patterns and idioms · 1.5.4 Monads · 1.6 Summary

What you learn in chapter 1 →

Chapter 2: The basics of functional declarative design

2.1 The engineering approach · 2.1.1 Software architecture classification · 2.1.2 Design tools and abstractions · 2.1.3 Top-down iterative development process · 2.1.4 Collecting requirements · 2.1.5 Requirements in mind maps · 2.2 Application architecture · 2.2.1 Architecture layers · 2.2.2 Embedded domain-specific languages · 2.2.3 Modularization of applications · 2.3 Summary

What you learn in chapter 2 →

Chapter 3: Drafting the MVP application

3.1 Goals, requirements, and plans · 3.1.1 Minimum viable product · 3.1.2 Andromeda software requirements · 3.1.3 The hardware subsystem · 3.1.4 Logic control scripts · 3.2 Designing the architecture · 3.2.1 Defining architecture components · 3.2.2 Defining modules, subsystems, and relations · 3.2.3 Defining the application architecture · 3.2.4 Module organization · 3.3 Naive implementation of the hardware subsystem · 3.3.1 The structure of the hardware subsystem · 3.3.2 Algebraic definition of HDL · 3.3.3 Functional interface to the hardware subsystem · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: End-to-end design

4.1 Finding the place for the end-to-end design · 4.1.1 Identifying and fixing wrong dependencies · 4.1.2 Improving models and naming · 4.1.3 Improving the Hdl language and interpreter · 4.1.4 Tests as a final consumer · 4.2 Functional services · 4.2.1 Layers and sublayers · 4.2.2 The Service Handle pattern · 4.2.3 Hardware service · 4.2.4 Mocking with the Service Handle pattern · 4.2.5 Type class-powered service handle · 4.3 Summary

What you learn in chapter 4 →

Chapter 5: Embedded domain-specific languages

5.1 Approaching embedded DSLs · 5.1.1 Everything is an eDSL · 5.1.2 Domain specific vs. domain centric · 5.2 Modeling eDSLs with algebraic data types · 5.2.1 Clarifying the requirements · 5.2.2 Modeling eDSLs with ADTs · 5.2.3 Modeling multiple interacting eDSLs · 5.2.4 Decoupling languages with parameterized ADTs · 5.3 Implementation of eDSLs · 5.3.1 Runtime objects and lifetimes · 5.3.2 Impure stateful interpreters · 5.4 Summary

What you learn in chapter 5 →

Chapter 6: Domain modeling with free monads

6.1 Introducing free monads · 6.2 Free monads as a functional interface · 6.2.1 Decoupling of computation and interpretation · 6.2.2 The Free Monad pattern · 6.2.3 Advantages and disadvantages · 6.3 How free monads work · 6.3.1 Wrapping languages into the free monad · 6.3.2 The Free type · 6.3.3 The functor instance · 6.3.4 Learning the recursive free type · 6.3.5 Interpretation of free monadic scripts · 6.4 Free monadic eDSLs · 6.4.1 Improving eDSLs with the free monad · 6.4.2 Hierarchical free eDSLs · 6.5 Summary

What you learn in chapter 6 →

Chapter 7: Stateful applications

7.1 Stateful functional programming · 7.1.1 Simple stateful application · 7.1.2 Purity, layering, state, and design · 7.2 State-handling approaches · 7.2.1 Argument-passing state · 7.2.2 Pure state with the state monad · 7.2.3 Bringing pure state into your monadic eDSLs · 7.2.4 Impure mutable state · 7.3 Summary

What you learn in chapter 7 →

Chapter 8: Reactive applications

8.1 Actor model · 8.1.1 Simulation of actors · 8.1.2 The architecture of the simulator · 8.1.3 The MVar Request–Response pattern · 8.2 Implementing the simulator · 8.2.1 Simulator as an actor · 8.2.2 Stateful simulation model · 8.3 Summary

What you learn in chapter 8 →

Chapter 9: Concurrent application framework

9.1 Multithreaded applications · 9.1.1 Why is multithreading hard? · 9.1.2 Bare threads · 9.1.3 Separating and abstracting the threads · 9.1.4 Threads bookkeeping · 9.2 Software transactional memory · 9.2.1 Why STM is important · 9.2.2 STM-powered runtime of the framework · 9.2.3 Incorporating STM · 9.3 Summary

What you learn in chapter 9 →

Chapter 10: Foundational subsystems

10.1 Logging subsystem · 10.1.1 Logger design · 10.1.2 Global static mutable logger · 10.1.3 Structured logging interface · 10.1.4 Structured logging implementation · 10.2 Advanced state management · 10.2.1 Wrapping STM with the Typed-Untyped design pattern · 10.2.2 State subsystem and logging · 10.2.3 Trackable state · 10.3 Resource initialization and the Bracket pattern · 10.3.1 RAII in OOP languages · 10.3.2 The Bracket pattern · 10.4 Summary

What you learn in chapter 10 →

Chapter 11: Persistence: Key–value databases

11.1 Raw untyped key–value database subsystem · 11.1.1 Native key–value database libraries · 11.1.2 String-based key–value database interface · 11.2 Type-safe key–value database subsystem · 11.2.1 Basic key–value database model · 11.2.2 Approaching the type-level design · 11.2.3 Type-safe key–value database model · 11.2.4 Generic type-safe key–value interface · 11.3 Summary

What you learn in chapter 11 →

Chapter 12: Persistence: Relational databases

12.1 Relational database model · 12.1.1 Designing relational database model ADTs · 12.1.2 Primary keys and the HKD pattern · 12.1.3 Polymorphic ADTs with the HKD pattern · 12.2 Relational database subsystem · 12.2.1 SQL connectors · 12.2.2 The consequences of complexity and high coupling · 12.3 Summary

What you learn in chapter 12 →

Chapter 13: Error handling and dependency inversion

13.1 Error handling through architectural layers · 13.1.1 Errors vs. exceptions · 13.1.2 Error domains · 13.1.3 Native exception-handling schemes · 13.1.4 Exceptions in free monadic languages · 13.2 Functional interfaces and dependency inversion · 13.2.1 The Dependency Inversion principle · 13.2.2 Service Handle pattern · 13.2.3 ReaderT pattern · 13.2.4 Free monad · 13.2.5 GADT · 13.2.6 Final tagless/mtl · 13.2.7 Comparison of the approaches · 13.3 Summary

What you learn in chapter 13 →

Chapter 14: Business logic design

14.1 Command-line client application · 14.1.1 API data model and HTTP schema · 14.1.2 Command-line interaction · 14.1.3 HTTP client functionality · 14.2 Server application · 14.2.1 Extended HTTP schema · 14.2.2 Using the framework for business logic · 14.2.3 Web server · 14.2.4 Validation · 14.3 Summary

What you learn in chapter 14 →

Chapter 15: Testing

15.1 Testing in functional programming · 15.1.1 Testing basics · 15.1.2 Property-based testing · 15.1.3 Property-based testing of a free monadic scenario · 15.1.4 Integration testing · 15.1.5 Acceptance testing · 15.2 Advanced testing techniques · 15.2.1 Testable architecture · 15.2.2 Mocking with free monads · 15.2.3 White-box unit testing · 15.2.4 Testing framework · 15.2.5 Testability of different approaches · 15.3 Summary

What you learn in chapter 15 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.