Skip to content

Instantly share code, notes, and snippets.

@kyagrd
kyagrd / MicroKanren.hs
Created December 13, 2015 12:31 — forked from msullivan/MicroKanren.hs
MicroKanren (μKanren) in Haskell
import Control.Monad
type Var = Integer
type Subst = [(Var, Term)]
type State = (Subst, Integer)
type Program = State -> KList State
data Term = Atom String | Pair Term Term | Var Var deriving Show
-- Apply a substitution to the top level of a term