/equirecursive-golang

Brief demonstration of Go's inclusion of (equi)recursive types

Primary LanguageGoMIT LicenseMIT

equirecursive-golang

Brief demonstration of Go's equirecursive types. One little-known aspect of Go's type system is that it support equirecursive types. The only place that I have seen this in use is with state machine-like computations, with types like:

type State func(Label)State

This repo shows how the subset of go without looping constructs or explicit recursion (or if) but with recursive types is Turing-complete by showing how to do some standard computations with the un(i)typed lambda calculus.