Designing Walrus: Relational Programming with Rich Types, On-Demand Laziness, and Structured Traces

Santiago Cuéllar, Naomi Spargo, Jonathan Daugherty, David Darais

Published: 2025/10/2

Abstract

We present Walrus, a functional relational programming language embedded in Haskell that extends the miniKanren model with type-polymorphic unification, on-demand laziness, and a range of usability features aimed at practical development. These include use of Haskell Generics for boilerplate reduction, structured debugging traces, and ergonomic support for product types. We describe the design and implementation of Walrus through the lens of our experience developing bidirectional compilers, and reflect on key design decisions and recurring usability challenges encountered in practice.