Golonzo
Golonzo is an attempt to bring type-safe functional programming to Go.
It is inspired by Haskell and fantasy-land, among other things.
We are currently porting some of Haskell's base package, and in particular, its list functions.
Usage
This package isn't stable, and hasn't been tagged with a version.
The following example demonstrates the Map
and Intersperse
functions for slices:
package main
import (
"fmt"
s "github.com/Benschar1/golonzo/slices"
)
func main() {
strLen := func(str string) int {
return len(str)
}
strs := []string{
"abc", // len is 3
"def", // len is 3
"golonzo church", // len is 14
}
// [3 3 14]
s1 := s.Map(strLen)(strs)
// [3 0 3 0 14]
s2 := s.Intersperse(0)(s1)
}
History
Golonzo Church (center), Alonzo Church (right), and unknown (left)
Golonzo is the eponymous brainchild of Golonzo Church, inventor of the lambda calculus.
Golonzo initially saw more promise in the imperative, concurrent programming paradigm than in his own, and created Go.
But when an apple fell and hit Golonzo's head one fateful day, he realized that carefully-controlled interaction with the real world via IO monads was the only sensible preventative measure for such events.
It was then that Golonzo and his friend Haskell Curry set out to create Haskell.
Golonzo has more recently set the task of porting Haskell constructs to Go, resulting in this library.
This has entailed sidelining his long-running campaign to heighten awareness of historical revisionism.