What you will learn in Type-Driven Development with Idris
Chapter by chapter
Chapter 1: Chapter 1. Overview
Introduces type-driven development, contrasts types with tests, and outlines the capabilities of first-class types in Idris.
What you learn in chapter 1 →Chapter 2: Chapter 2. Getting started with Idris
This introduction previews Idris fundamentals and a simple program for calculating average word length.
What you learn in chapter 2 →Chapter 3: Chapter 3. Interactive development with types
This introduction explains the type, define, refine workflow and how Idris-powered editor features support it.
What you learn in chapter 3 →Chapter 4: Chapter 4. User-defined data types
This introduction explains why precise, problem-specific data types are valuable in type-driven development.
What you learn in chapter 4 →Chapter 5: Chapter 5. Interactive programs: input and output processing
This introduction explains how Idris combines pure functions with interactive programs described using IO and executed by the runtime.
What you learn in chapter 5 →Chapter 6: Chapter 6. Programming with first-class types
This introduction explains first-class types in Idris and illustrates calculating types from data.
What you learn in chapter 6 →Chapter 7: Chapter 7. Interfaces: using constrained generic types
This introduction explains how interface constraints make generic types more precise and how interfaces describe operations implemented for different types.
What you learn in chapter 7 →Chapter 8: Chapter 8. Equality: expressing relationships between data
This introduction explains how types can express relationships between data and why a compiler may need help establishing them.
What you learn in chapter 8 →Chapter 9: Chapter 9. Predicates: expressing assumptions and contracts in types
This introduction explains predicates as types expressing properties and shows how assumptions in types serve as checked function contracts.
What you learn in chapter 9 →Chapter 10: Chapter 10. Views: extending pattern matching
This section introduces views as dependent types that offer alternative ways to pattern-match and observe data.
What you learn in chapter 10 →Chapter 11: Chapter 11. Streams and processes: working with infinite data
This introduction contrasts batch processing with streams and explains how production, consumption, termination, and productivity relate in programs that run indefinitely.
What you learn in chapter 11 →Chapter 12: Chapter 12. Writing programs with state
This introduction explains how Idris programs can work with state despite immutable variables, and distinguishes application-wide state from state local to an algorithm.
What you learn in chapter 12 →Chapter 13: Chapter 13. State machines: verifying protocols in types
This introduction explains how separate operation descriptions and state-machine models can help express and enforce protocols in types.
What you learn in chapter 13 →Chapter 14: Chapter 14. Dependent state machines: handling feedback and errors
This introduction reviews typed state-transition guarantees and explains why realistic state machines must account for failures and environmental responses.
What you learn in chapter 14 →Chapter 15: Chapter 15. Type-safe concurrent programming
This introduction explains processes, message-passing concurrency, and reasons to run processes concurrently.
What you learn in chapter 15 →Concepts explained in this book
- viewAn alternative representation of a value that exposes its structure for pattern matching without requiring access to the value’s original constructors.
- process typeThe book's Idris Process type describes computations that perform IO and protocol-governed message-passing operations.
- data typeA type whose values are defined by constructors that specify ways to build values of that type.
- state monadThe state monad represents computations that read and update state while producing a result.
- type-driven developmentAn iterative development process of specifying types, implementing functions that satisfy them, and refining both as understanding grows.
- type-level functionA function whose input and output are evaluated or interpreted in type positions to determine types.
- vectVect is an Idris length-indexed vector type whose length and element type are represented in its type.
- dependent typeA type whose definition can depend on values, allowing it to express more precise program properties.
- case splittingCase splitting is a development technique that divides an implementation into branches corresponding to the possible forms or values of an expression.
- IOAn IO action is an Idris computation that can interact with the external world and return a result.
- genericsA generic type is a type parameterized by one or more types.
- DecEqDecEq is the Idris interface for types whose equality can be decided with evidence for either equality or inequality.
- Idris interfaceAn Idris interface specifies generic operations that can have implementations for different types.
- recursionA technique in which a definition refers to itself to solve a problem through smaller instances of that problem.
- with constructThe Idris with construct allows a function to pattern-match on an intermediate expression alongside its original inputs.
- preconditionA condition that must hold before an operation or process can be executed.
- DecDec is an Idris Prelude generic type whose values represent either a proof of a proposition or a proof that the proposition is impossible.
- interface constraintA type-level requirement that a type implement an interface in order to be used in a constrained definition.
- equalityThe relation that holds when two values or expressions have the same value.
- decidabilityDecidability is the property of a predicate for which an algorithm can determine, for any given input, whether it holds.
- pattern matchingA programming technique that defines behavior by distinguishing values according to their structure or constructor.
- do notationIdris syntax for writing sequences of effectful computations in a more readable form than explicit use of the bind operator.
- InfIOInfIO is an Idris type describing an infinite sequence of interactive actions whose later actions can depend on earlier results.
- state transitionA state transition is a change from one state of a system to another as a result of an operation.
- EqAn Idris interface whose methods specify equality and inequality comparisons for a type.
- case statementAn expression that evaluates a value and selects a result by matching it against alternatives.
- dependent pattern matchingDependent pattern matching is pattern matching in which matching a value can reveal information about the types or forms of related values.
- insertion sortA sorting algorithm that builds a sorted sequence by inserting each element into its correct position in the already-sorted portion.
- merge sortMerge sort is a sorting algorithm that recursively divides a list into smaller parts and merges the sorted parts.
- monadA programming abstraction that provides operations for sequencing computations whose results determine subsequent computations.
- variable in typeA type-level variable stands for a value used at the type level, such as a collection length.
- parsingThe process of converting textual input into a structured representation according to a grammar or format.
- bind operatorThe Idris Prelude operator >>= sequences computations by passing the result of one computation to a function that produces the next.
- equality typeAn Idris type whose values witness that two expressions are equal, with Refl witnessing equality of identical expressions.
- transpositionThe operation that converts the rows of a matrix into columns and its columns into rows.
- iselemisElem is an Idris function that decides whether an element occurs in a collection, returning evidence of membership or non-membership.
- patternA syntactic form that describes the shape or value an input must match for a function clause to apply.
- stackA stack is the example data structure whose items are added to and removed from its top, with only the top item accessible.
- interactive programA program that describes interactions with the external world, such as reading input or displaying output.
- program holeA program hole is a placeholder for an unfinished expression that can be filled in later.
- expression searchExpression search is a type-directed development technique that searches for an expression satisfying the type of an incomplete program term.
- data constructorA language construct that creates a value of a data type.
- totality checkingTotality checking determines whether a program definition is total.
- first-class typeA first-class type is a type that can be manipulated as a language-level value rather than serving only as a static annotation.
- LazyLazy is an Idris type constructor marking a computation whose result is evaluated only when required.
- constrained generic typeA constrained generic type has type parameters restricted by required interface constraints.
- rewritingThe process of replacing an expression with another expression according to a rule.
- VoidAn empty Idris type with no values, commonly used to represent an impossible proposition.
- FinFin is an Idris type whose values represent natural numbers strictly less than a bound encoded in the type.
- total functionTotality is the property of a function that covers every well-typed input and either terminates or produces data productively.
- type checkingType checking is the process of verifying that a program satisfies the constraints imposed by its types.
- FuelAn Idris data type representing a supply of computation steps used to bound recursive execution.
- dependent pairA dependent pair is a pair whose second component's type can depend on the value of its first component.
- SnocList viewSnocList is an example list view that exposes a list as empty or as a prefix followed by its final element.
- namespaceA namespace is a named scope that organizes definitions and distinguishes their fully qualified names.
- type constructorA type constructor is a construct that takes types or values as arguments and forms a type.
- auto implicit argumentAn Idris implicit argument marked with auto, for which the compiler searches automatically for a value.
- ForceForce is an Idris function that requests evaluation of an expression previously marked with Delay.
- spawnAn Idris concurrency function that starts a process executing an IO action and returns its process identifier if successful.
- exportThe Idris export modifier makes a declaration's name and type available to importing modules while hiding its definition or data constructors.
- foldableFoldable is an Idris interface for structures that can be reduced to a single value using an initial value and a combining function.
- mathematical proofA proof is evidence establishing that a proposition is true, represented in Idris by a value whose type expresses that proposition.
- recursive viewA recursive view is a view whose structure includes a recursively smaller view of part of the value it represents.
- function typeA function type specifies the types of a function's inputs and result.
- ChannelChannel is a primitive Idris abstraction for communication between concurrent processes.
- UninhabitedUninhabited is an Idris interface for types that have no values, requiring a method that returns an element of the empty type.
- showshow is an Idris Prelude function that converts a value supporting the Show interface to a string representation.
- foldlAn Idris Prelude function that reduces a foldable structure from the left using a combining function and an initial value.
- union typeA data type whose constructors can carry associated data, with different constructors able to carry different data.
- implicit argumentAn Idris function argument whose value is inferred from context rather than supplied explicitly, but remains available inside the function definition.
- repl functionThe Idris Prelude repl function repeatedly applies a string-processing function to console input and displays its output.
- higher-order functionA higher-order function is a function that accepts another function as an argument or returns a function as its result.
- type familyA type family is a collection of types whose specific type is determined by one or more indices.
- appendAppend is an operation in the example list-service interface that requests the concatenation of two lists.
- interface implementationAn interface implementation provides definitions for the methods of an interface for a particular type or context.
- message passingMessage passing is communication between processes by sending and receiving messages.
- NumNum is the Idris interface for types that support numeric operations, including addition, multiplication, and conversion from integer literals.
- evaluationThe process of computing the value of an expression by executing its semantics.
- automated teller machineAn automated teller machine is a self-service banking machine used as an example domain for type-checked state changes.
- prefix parsingPrefix parsing interprets the beginning of an input while preserving the unparsed remainder.
- underscore placeholderAn underscore placeholder is Idris syntax that asks the system to infer a value when the context determines a valid value.
- vending machineA vending machine is a subject of the chapter’s example model for illustrating states and operations.
- covering functionA covering function constructs a view corresponding to a value so that the view represents that value's structure.
- DelayDelay is an Idris function that controls when a subexpression is evaluated by leaving its argument unevaluated until forced.
- OrdAn Idris interface for types whose values can be compared in an ordering.
- impossible keywordThe Idris impossible keyword marks a pattern-matching clause whose pattern cannot match a well-typed value.
- abstract stateAbstract state is a representation of system state that expresses selected properties without specifying all of its concrete information.
- type aliasA type synonym is an alternative name for an existing type, often chosen to make the type's meaning clearer.
- snoc listA snoc list is a list representation in which each added element follows the list containing the preceding elements.
- variadic argumentsA facility for passing a variable number of arguments to a function, without necessarily encoding their count in the types.
- productive total functionA productive total function is a total function that produces a constructor after a finite amount of computation, including when describing infinite data.
- side effectAn observable effect of a computation beyond producing its result, such as input, output, or a destructive action.
- listList is Idris's generic data type for ordered sequences of values, without encoding their length in the type.
- System.Concurrency.ChannelsSystem.Concurrency.Channels is an Idris base-library module providing primitives for starting concurrent processes and communicating between them.
- methodA method is a function declared as part of an interface and implemented for particular types or contexts.
- projection functionA function generated for a record field that retrieves that field’s value from a record.
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.
