What you will learn in Functional Design and Architecture: Examples in Haskell
Examples in Haskell
Chapter by chapter
Concepts explained in this book
- free monadThe Free Monad pattern represents a sequence of domain operations as a data structure that can be interpreted independently from execution.
- contractAn application programming interface is a defined contract through which software clients interact with a component or service.
- embedded domain-specific languageAn embedded domain-specific language is a domain-focused language implemented within a host programming language and represented using the host's syntax or abstractions.
- HdlHdl is a book-specific embedded domain-specific language for defining hardware devices and registering their components in the Andromeda control software.
- software transactional memorySoftware transactional memory is a concurrency technique that manages shared state through transactional memory operations rather than explicit locking, with composable transactions supporting coordinated composition.
- functional, stateless philosophyA programming approach that represents computation primarily through the evaluation and composition of functions, favoring immutable data and minimized side effects.
- designThe creative activity of selecting and organizing software structures and mechanisms to satisfy requirements while managing trade-offs.
- continuationA continuation is a function representing the remainder of a computation and receiving the result of an intermediate operation.
- algebraic data typeAn algebraic data type is a composite type formed from alternatives, products, or both, with its structure described by type constructors.
- functional interfaceA functional interface is an abstraction defining communication between subsystems through functional representations rather than object-oriented method dispatch.
- couplingDecoupling is the reduction of dependencies between software components or language modules so they can change more independently.
- smart constructorA smart constructor is a specialized construction function that creates values while presenting a more convenient or constrained interface than the underlying data constructor.
- functional declarative designFunctional declarative design is a development-cycle methodology for designing software in statically typed functional languages through declarative specifications and functional abstractions.
- hierarchical free monadA hierarchical free monad is an architectural design pattern that organizes composable free-monad-based program structure hierarchically.
- monad stackA monad stack is a composition of nested monads that presents their combined effects through one monadic interface.
- generalized algebraic data typeA generalized algebraic data type is an algebraic data type whose constructors can provide more specific type information than the surrounding type declaration.
- stateState is the information representing the current condition of a computation or system and that may affect subsequent behavior.
- state monadA state monad is a monadic abstraction that threads changeable state through computations while presenting state transitions as composable values.
- monad transformerA monad transformer is a type-level abstraction that adds one monad's effects to another monad.
- domain-specific languageA domain-specific language is a programming language designed for a particular application domain, including an embedded form hosted within another language.
- type-level designType-level programming is a programming technique that computes or encodes program information and constraints in a type system.
- exceptionA synchronous exception is an exception raised and handled within the execution flow of the thread that encounters the abnormal condition.
- service handle patternThe Service Handle pattern represents access to a service through an explicit handle that encapsulates the service interaction boundary.
- type classA type class is a language feature that defines a common interface of operations and permits implementations for different types.
- race conditionA race condition is a concurrency defect in which the outcome depends on an unexpected competition between threads for a shared resource.
- white-box testingWhite-box unit testing is testing that verifies internal code paths and implementation details in addition to externally observable behavior.
- thread safetyThread safety is the property that shared code or data remains correct when accessed concurrently by multiple threads.
- LogicControlLogicControl is the book's embedded domain-specific language for expressing spaceship control logic and higher-level domain operations.
- functional reactive programmingA functional reactive pipeline is a composition of functional processing stages that propagates changing or time-varying values through a data-flow structure.
- mockingA mock is a configurable test-double implementation that simulates a real component or service without invoking the real one.
- dependency injectionDependency injection is a technique for supplying a component's external functionality through an abstraction rather than constructing or selecting its concrete implementation internally.
- business logicBusiness logic is the set of domain rules and application behaviors that determine how a system responds to business situations.
- reactive streamReactive Streams is a standard for asynchronous stream processing with non-blocking backpressure between producers and consumers.
- primary keyA primary key is a field or combination of fields that uniquely identifies a record in a database.
- MVarAn MVar is a Haskell mutable synchronization variable that stores either no value or one value and supports coordinated access between concurrent computations.
- multi-tier applicationLayering is an organizational pattern that arranges software components into levels with constrained dependencies between levels.
- IORefIORef is a Haskell mutable reference type that provides an IO-based interface for reading and updating a stored value.
- key-value storeKey-value storage is a storage model that associates values with keys for retrieval and update.
- object-oriented programmingA programming paradigm that organizes software around objects combining state with behavior and supports mechanisms such as encapsulation, inheritance, and polymorphism.
- actorA concurrent actor is an independent computational entity that receives requests, updates private state, and produces responses or effects.
- higher-kinded data patternA higher-kinded data type is a parameterized data type whose field types can be systematically transformed by a type constructor.
- determinismDeterminism is the property that the same inputs and conditions produce a predictable, uniquely determined result.
- mvar request-response patternThe MVar request-response pattern is a communication pattern in which a service thread receives requests through an MVar and returns results through a response channel.
- dependency inversionThe dependency inversion principle is a design principle requiring high-level policy to depend on abstractions rather than directly on low-level implementation details.
- property-based testingProperty-based testing evaluates software by checking general behavioral properties across automatically generated inputs rather than relying only on hand-written example cases.
- recursive data structureA recursive data type is a type whose definition refers to itself, allowing it to represent recursively structured values.
- side effectAn observable interaction produced by a computation beyond returning its value, such as changing state or performing input and output.
- testA test case is a defined test scenario with inputs, actions, and expected results for evaluating specific behavior.
- leaky abstractionA leaky abstraction is an abstraction whose exposed behavior or interface reveals details of its underlying implementation.
- integration testAn integration test verifies that multiple software components work together correctly in an environment representing their actual integration conditions.
- pure functionA pure algorithm is an algorithm whose result is determined by its inputs and which produces no observable side effects.
- thread poolA thread pool is a managed collection of reusable worker threads whose size limits concurrent thread execution.
- StateTStateT is a Haskell monad transformer that adds a mutable-state abstraction to an underlying monadic computation.
- LangLLangL is a book-specific language for application-level computations that can perform input-output effects such as logging.
- AppLAppL is a book-specific free-monadic language for declaring application initialization, process structure, configuration, and related orchestration logic.
- DeviceControlDeviceControl is a book-specific embedded domain-specific language for interacting with devices by reading sensors and obtaining status.
- union typeA sum type represents a value that can be one of several alternative constructors or variants.
- lensThe lens library is a Haskell library for composable querying and updating of focused parts of data structures.
- metaprogrammingMetaprogramming is the manipulation or generation of program representations to produce or transform code, often during compilation.
- product typeA product type combines multiple component values into one composite value, such as a tuple or record.
- signalA signal is a time-varying value in a functional reactive system whose changes can drive dependent computations.
- TVarA TVar is a transactional mutable variable used by Haskell's software transactional memory mechanisms.
- cohesionCohesion is the degree to which the responsibilities and internals of a software component belong together.
- lifetimeThe lifetime of an abstraction is the span of program development or execution stages during which that abstraction remains present and meaningful.
- simulatorA simulator is software or equipment that reproduces the behavior of a system for observation or control without operating the real system.
- functorA functor is an abstraction that supports mapping a function over a value while preserving the structure of its context.
- monitoringLogging is the recording of runtime events and diagnostic information produced by software.
- domain modelA domain model is a structured representation of the concepts, properties, relationships, and behavior of a problem domain.
- accidental complexityAccidental complexity is complexity introduced by implementation choices, tools, or code rather than inherent requirements of the problem domain.
- requirementsA requirement is a stated capability, constraint, or goal that a software system must satisfy.
- deviceA device is a runtime abstraction representing a physical hardware component and the operations for connecting to it, reading measurements, and evaluating commands.
- static typingA statically typed language checks the types of program constructs before execution, typically during compilation.
- schemaA database schema is the structure defining the data types, fields, and relationships represented in a database.
- modularityModularity is a structural property in which a program is divided into relatively independent parts with separable responsibilities.
- concurrencyA programming technique for structuring multiple computations whose execution can overlap in time.
- statefulnessA stateful application is an application whose behavior depends on information retained across operations or interactions.
- beambeam is a Haskell library for declaring relational database schemas and constructing type-safe SQL queries across multiple database backends.
- HydraHydra is the book's framework for structuring safe business logic with composable monadic languages and controlled effects.
- state-passingState-passing is a technique in which state is supplied as a function argument and the resulting computation returns updated state.
- atomicityAtomicity is the property that a transaction's operations take effect as one indivisible unit.
- impure stateful interpreterA stateful interpreter is an interpreter whose evaluation carries and updates mutable or otherwise persistent execution state.
- api modelAn API model is a data representation designed for communication across an application programming interface rather than for internal domain behavior.
- retryRetry is an STM operation that rolls back a transaction and waits for relevant transactional variables to change before restarting it.
- Final TaglessFinal Tagless is a functional design pattern that represents a program through an abstract interface interpreted by one or more implementations.
- simplicitySimplicity is a property of software that limits unnecessary complexity and makes its behavior easier to understand and change.
- mock interpreterA mock interpreter is an interpreter implementation that simulates effects or external actions for isolated testing.
- mtlmtl is a Haskell library providing type classes and monad transformers for expressing computations with composable effects.
- separation of concernsSeparation of concerns is a design principle that isolates distinct responsibilities so they can be understood and changed independently.
- data modelA database model is a representation of how data is structured and related within a database's internal storage system.
- ReaderT monadReaderT is the Haskell monad transformer that adds an immutable environment to an underlying monadic computation.
- inversion of controlInversion of control is a design technique in which client code depends on an interface or abstraction rather than directly controlling or selecting a concrete implementation.
- phantom typeA phantom type is a type parameter that appears in a type declaration but not in the runtime representation of its values.
- monadA monad is an abstraction that sequences computations while encapsulating a computational context such as optionality, state, errors, or input-output effects.
- liftinglift is a monad-transformer operation that embeds an action from an underlying monad into a transformed monad.
- use case diagramA use case diagram is a requirements-modeling diagram that shows actors, the actions they trigger, and the context of those actions.
- functional requirementA functional requirement specifies functionality that an application must provide for users to complete tasks.
- nonfunctional requirementA nonfunctional requirement specifies general qualities or operational constraints of an application rather than specific functions.
- risk managementThe systematic identification, evaluation, and mitigation of potential problems affecting a project or system.
- invariantAn invariant is a condition or property that remains true for every valid state or execution covered by its specification.
- Unified Modeling LanguageUML is a standardized visual modeling language for specifying, visualizing, and documenting software systems.
- mind mapMind mapping is a diagramming technique for organizing ideas and their relationships around a central topic.
- design patternAn object-oriented pattern is a language-agnostic, reusable solution structure for a recurring object-oriented design problem.
- impure layerAn impure layer is an architectural layer that performs side-effecting actions and interacts with the external world.
- pure layerA pure layer is an architectural layer containing deterministic code that describes behavior without performing impure evaluation.
- avatarAn avatar is a typed identifier representing an instantiated runtime object without containing the object itself.
- controller avatarA controller avatar is an Hdl value containing a controller name that identifies an instantiated controller for subsequent operations.
- newtype idiomA newtype is a distinct type wrapper around an existing representation that preserves its runtime representation while enforcing compile-time type distinctions.
- associated typeAn associated type is a type member declared within a type class or similar abstraction and determined by its implementing type.
- moduleA software module is a separately organized unit of code with a defined responsibility and boundary.
- extensibilityExtensibility is the ease with which a software system can accommodate new capabilities, types, or variations.
- multithreadingMultithreading is the concurrent execution of multiple threads within a process.
- imperative programmingA programming paradigm in which programs specify ordered operations that change data or produce side effects.
- forallforall is a Haskell type-level quantifier that introduces a locally scoped universally quantified type variable.
- functional programming patternA functional idiom is a recurring way of structuring code that expresses functional programming ideas, often using abstraction and mathematical reasoning.
- typed-untyped design patternThe Typed–Untyped design pattern separates a typed abstraction from an untyped representation or boundary to enable wrapping a complete subsystem abstraction.
- validationValidation is the systematic checking of input or data against rules before it is accepted for further processing.
- riskA risk is a potential problem whose occurrence can increase the cost, delay, or failure likelihood of a software project.
- fmapfmap is the standard functor-mapping operation that applies a function to a functor's contained values while preserving its structure.
- divide-and-conquer approachDivide and conquer is a design strategy that manages complexity by separating a problem into smaller, more independently tractable parts.
- protocolA communication protocol is a defined set of rules and message formats governing interactions between communicating software components.
- handlerA Handler is the Servant monad and request-handler type for implementing web operations and producing HTTP responses.
- optionThe Maybe type is an algebraic data type representing either an optional value or the absence of a value.
- logic controlLogic control is a subsystem that evaluates and directs hardware operation by sending commands, reading measurements, and calculating parameters.
- databaseA database is an organized system for storing, managing, and retrieving structured data.
- asynchronous exceptionAn asynchronous exception is an exception delivered independently of the execution point of the thread or computation it interrupts.
- SOLID principlesSOLID is a set of five object-oriented design principles concerning responsibility, extensibility, substitutability, interface design, and dependency management.
- AsValueEntityAsValueEntity is a book-specific Haskell type class that defines conversions between a database entity representation and its corresponding domain type.
- failureAn error is a condition in software or its environment indicating that a computation or requested operation cannot produce the intended result.
- ComponentDefComponentDef is a book-specific data type representing a component definition or blueprint in an Hdl specification.
- ship modelA ship model is a domain model representing the ship's control network scheme and hardware descriptors.
- black-box testingBlack-box testing evaluates software through externally observable behavior without relying on knowledge of its internal implementation.
- opaque typeAn opaque data type is a data type whose representation is hidden from client code behind an abstraction boundary.
- declarative definitionA declarative definition specifies the structure or intended result of an artifact without describing its execution procedure.
- QuickCheckQuickCheck is a library for property-based testing that generates test inputs and checks specified properties against them.
- Servantservant-client is a Haskell library that derives client functions for making HTTP requests from Servant API specifications.
- do notationDo notation is Haskell syntax for expressing a sequence of monadic computations with implicit binding between steps.
- testabilityTestability is the degree to which software can be evaluated effectively through automated or systematic tests.
- test interpreterA test interpreter is an interpreter implementation that evaluates scenario steps while recording or simulating effects for verification.
- essential complexityComplexity inherent in the problem domain that cannot be removed without failing to support required behavior.
- UML class diagramA UML diagram that represents classes, interfaces, implementations, and relationships in an object-oriented system.
- sensor APIA sensor API is the interface for reading measurements and otherwise interacting with a device sensor.
- applicative styleApplicative validation is a validation technique that combines independent checks while accumulating their errors rather than stopping at the first failure.
- configurationA config is a collection of application settings that controls how software is initialized or operates.
- pointed getterA pointed getter is a getter that returns both a focused value and the path identifying that value within a structure.
- pointed-validationpointed-validation is a Haskell library for applicative validation that records the location of errors within possibly hierarchical data structures.
- serializationSerialization is the transformation of structured data into a representation suitable for storage or transmission and later reconstruction.
- HdlMethodHdlMethod is a book-specific operation that combines device definition, device interaction, and reporting responsibilities in the Hdl-based control design.
- preconditionA precondition is an input condition that must hold before a user scenario or system operation begins.
- combinatorA combinator is a function or expression-building operation that combines smaller computational elements into a larger computation.
- pattern matchingPattern matching is a language mechanism that selects behavior by matching a value against structural patterns and binding its components.
- functional testingTesting that evaluates specified functionality or an isolated unit of application logic without invoking real external services.
- ExceptTExceptT is a Haskell monad transformer that adds computations which can terminate with an error value to an underlying monad.
- minimal productA minimum viable product is a usable product version with sufficient functionality to validate the product idea and support further development.
- relational modelA data model that represents information as relations, typically implemented as tables whose structure is defined by a relational schema.
- putMVarputMVar is a Haskell operation that places a value into an MVar, blocking while the MVar is full.
- takeMVartakeMVar is a Haskell operation that removes and returns the value in an MVar, blocking while the MVar is empty.
- encapsulationEncapsulation is a design and language mechanism that hides an entity’s internal representation while exposing a controlled interface.
- requirements modelA requirements model is a structured set of descriptions of the properties and capabilities a software product is expected to have.
- explicit errorAn explicit error is a failure represented as a value in a program's data rather than raised implicitly through exception control flow.
- KVDBLKVDBL is a book-specific free-monadic language providing a raw string-based interface to a key-value database.
- floating-point arithmeticA floating-point data type represents approximate real-number values using a finite-precision fractional representation.
- natural keyA natural key is a database key formed from one or more attributes that have inherent meaning in the represented domain.
- bracket functionThe bracket pattern is a resource-management pattern that acquires a resource, runs an action with it, and ensures disposal after the action finishes.
- error domainAn error domain is an isolated application part with a predefined error-handling mechanism and a guarantee that other error behavior will not occur within it.
- bindBind is the monadic operation that sequences a computation producing a contextual value with a function that consumes that value and produces the next contextual computation.
- typed avatar patternThe Typed Avatar pattern represents an instantiated runtime object with a typed identifier while the actual value is stored in an untyped structure.
- hardware description languageA hardware description language is a language for specifying the structure or behavior of electronic hardware and hardware systems.
- closed type familyA closed type family is a type family whose equations are fixed in its declaration and cannot be extended by separate instances.
- type familyA type family is a type-level function that computes a result type from one or more input types.
- mnemonic analysisMnemonic analysis is a domain-analysis technique that transforms a scenario into a more formal representation to reveal internal domain properties.
- atomic typeA data type is a type that defines a set of possible values together with the constructors used to build those values.
- Liskov Substitution PrincipleA design principle requiring objects substituted for an abstraction to preserve the behavioral expectations of clients using that abstraction.
- programming by contractA software-design technique that expresses behavioral contracts explicitly and checks implementations against them.
- external dslAn external domain-specific language is a domain-specific language defined independently of a host programming language and processed by its own tooling.
- purePure is a value constructor that terminates a free-monad computation and stores the final value to be returned.
- functional dependencyA functional dependency is a type-class declaration constraint stating that certain type parameters determine other type parameters.
- native errorA native error is a failure originating outside an application's framework and business logic, such as from a language ecosystem or external library.
- IOIO is the Haskell type constructor for computations that may perform input, output, or other external effects.
- domain typeA domain type is a program type whose values represent concepts from the real-world problem domain.
- simulation runtimeA simulation runtime is the state maintained by a simulator while it processes simulation requests.
- refactoringRefactoring is the disciplined restructuring of existing code without intentionally changing its externally observable behavior.
- requirements analysisRequirement analysis is the process of eliciting, examining, and specifying the capabilities and constraints a software system must satisfy.
- domain-driven designDomain-driven design is a software development methodology that centers software design on the concepts, relationships, and rules of the problem domain.
- coarse-grained data modelA coarse-grained data model organizes mutable data into large units that must be replaced together during updates.
- fine-grained data modelA fine-grained data model organizes mutable data into independently updateable smaller units.
- granularityGranularity is the size of the independently mutable units into which data or computation is divided.
- simulation modelA simulation model is a computational representation of a system whose behavior can be executed and observed in a simulator.
- architecture diagramAn architecture diagram is a formal visual model of a software system's important subsystems, relationships, and concrete architectural decisions.
- value constructorA value constructor is a constructor that creates a value of an algebraic data type and may expose part of its representation.
- runStaterunState is a Haskell state-monad function that executes a stateful computation from an initial state and returns its result together with the final state.
- elements diagramAn elements diagram is an informal exploratory diagram in which software and domain elements are placed and related without a required central structure or formal notation.
- reactive programmingReactive programming is a programming technique for expressing computations that respond to continuously arriving events or changing data.
- serviceA software service is a separately organized component that provides functionality through a defined interaction boundary.
- hspechspec is a Haskell testing library for expressing specifications and organizing test cases.
- key-value modelA key-value database model is a typed representation of the keys and values stored by a key-value database for particular entities.
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.
