The Haskell Unfolder Episode 42: logic programming with typedKanren

Will be streamed today, 2025-04-16, at 1830 UTC, live on YouTube.

Abstract:

Functional programming is programming with mathematical functions, mapping inputs to outputs. By contrast, logic programming—perhaps best known from the language Prolog—is programming with mathematical relations between values, without making a distinction between inputs and outputs. In this two-year anniversary episode of the Haskell Unfolder we take a look at typedKanren, an embedding of the logic programming language miniKanren in Haskell. We will see how we can use it to write a type checker for a simple functional language in a few lines of code.

16 Likes

Very cool. In a dream I wondered if anybody ever tried to build a programming language where the class system was a mini Kanren.

That’d be such a cool fit for functional programming languages with classes.

And since you can use typedMiniKanren as a library, it almost comes for free if you’re implementing such a system in Haskell!

4 Likes

@MangoIV You may want to check out Shen.

3 Likes