Person. Ralf Hinze

Papers

Longest r-chain: thinning by grouping dinges-2026-longest

PDF · DOI · pldb

Truly Functional Solutions to the Longest Uptrend Problem (Functional Pearl) dinges-2025-truly

Solutions to the longest increasing subsequence problem are typically implemented imperatively, relying on arrays for constant-time lookups and updates. Replacing these arrays with functional sequences allows a purely functional solution with the same asymptotic running time, but with significantly worse practical performance. In this pearl, we present a purely functional approach that is not only asymptotically optimal, but also efficient in practice. The core idea is to exploit the interplay between search, lookup, and update operations through Huet’s zipper. In addition, we improve the adaptive behaviour of imperative solutions commonly found in the literature.
PDF · DOI · pldb

Binary search—think positive dinges-2025-binary

DOI · pldb

The graphical theory of monads hinze-2025-the

The formal theory of monads shows that much of the theory of monads can be developed in the abstract at the level of 2-categories. This means that results about monads can be established once and for all and simply instantiated in settings such as enriched category theory. Unfortunately, these results can be hard to reason about as they involve more abstract machinery. In this paper, we present the formal theory of monads in terms of string diagrams — a graphical language for 2-categorical calculations. Using this perspective, we show that many aspects of the theory of monads, such as the Eilenberg–Moore and Kleisli resolutions of monads, liftings, and distributive laws, can be understood in terms of systematic graphical calculational reasoning. This paper will serve as an introduction both to the formal theory of monads and to the use of string diagrams, in particular, their application to calculations in monad theory.
PDF · DOI · pldb

What’s in a Bag?: An “Application Proving Interface” for Finite Bags and its Implementation dinges-2023-what

DOI

Introducing String Diagrams: The Art of Category Theory hinze-2023-introducing

String diagrams are powerful graphical methods for reasoning in elementary category theory. Written in an informal expository style, this book provides a self-contained introduction to these diagrammatic techniques, ideal for graduate students and researchers. Much of the book is devoted to worked examples highlighting how best to use string diagrams to solve realistic problems in elementary category theory. A range of topics are explored from the perspective of string diagrams, including adjunctions, monad and comonads, Kleisli and Eilenberg–Moore categories, and endofunctor algebras and coalgebras. Careful attention is paid throughout to exploit the freedom of the graphical notation to draw diagrams that aid understanding and subsequent calculations. Each chapter contains plentiful exercises of varying levels of difficulty, suitable for self-study or for use by instructors.
DOI

Certified, total serialisers with an application to Huffman encoding hinze-2023-certified

The other day, I was assembling lecture material for a course on Agda. Pursuing an application-driven approach, I was looking for correctness proofs of popular algorithms. One of my all-time favourites is Huffman data compression (Huffman, 1952). Even though it is probably safe to assume that you are familiar with this algorithmic gem, a brief reminder of the essential idea may not be amiss.
PDF · DOI · pldb

Super-naturals hinze-2022-super

PDF · DOI · pldb

Algorithmics bird-2021-algorithmics

DOI

Self-certifying Railroad Diagrams: Or: How to Teach Nondeterministic Finite Automata hinze-2019-self

DOI

Relational algebra by way of adjunctions gibbons-2018-relational

Bulk types such as sets, bags, and lists are monads, and therefore support a notation for database queries based on comprehensions. This fact is the basis of much work on database query languages. The monadic structure easily explains most of standard relational algebra—specifically, selections and projections—allowing for an elegant mathematical foundation for those aspects of database query language design. Most, but not all: monads do not immediately offer an explanation of relational join or grouping, and hence important foundations for those crucial aspects of relational algebra are missing. The best they can offer is cartesian product followed by selection. Adjunctions come to the rescue: like any monad, bulk types also arise from certain adjunctions; we show that by paying due attention to other important adjunctions, we can elegantly explain the rest of standard relational algebra. In particular, graded monads provide a mathematical foundation for indexing and grouping, which leads directly to an efficient implementation, even of joins.
PDF · DOI · pldb

On constructing 2-3 trees hinze-2018-on

We consider the task of constructing 2-3 trees. Given a sequence of elements we seek to build a 2-3 tree–in linear time–that contains the elements in symmetric order. We discuss three approaches: top-down, bottom-up, and incremental. The incremental approach is more flexible than the other two in that it allows us to interleave the construction work with other operations, for example, queries.
PDF · DOI · pldb

Parberry’s pairwise sorting network revealed hinze-2018-parberry

PDF · DOI · pldb

Equational reasoning with lollipops, forks, cups, caps, snakes, and speedometers hinze-2016-equational

DOI

Conjugate Hylomorphisms -- Or: The Mother of All Structured Recursion Schemes hinze-2015-conjugate

PDF · DOI · pldb

Adjoint folds and unfolds—An extended study hinze-2013-adjoint

DOI

Kan Extensions for Program Optimisation Or: Art and Dan Explain an Old Trick hinze-2012-kan

DOI

Just do it: simple monadic equational reasoning gibbons-2011-just

PDF · DOI · pldb

Finger trees: a simple general-purpose data structure hinze-2005-finger

PDF · DOI · pldb

Generics for the masses hinze-2004-generics

PDF · DOI · pldb

Polytypic values possess polykinded types hinze-2002-polytypic

DOI
ralfhinze person entries/rolodex/ralfhinze.hel