golang-jsouthworth-immutable

module
v0.0.0-...-7241100 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2019 License: MIT

README

Immutable

GoDoc Build Status Coverage Status

This library implements several persistent datastructures for the go programming language. A vector based on Radix Balanced Trees with some optimizations adapted from Clojure. A HAMT based hashmap inspired heavily by Clojure's hashmap. A Red/Black tree based treemap based on Okasaki's persistent red/black tree with a deletion extension from Germane and Might.

Several additional overlay data-structures are provided for conveience. A list, queue, stack, hashset, and treeset are built on top of the 3 basic data-structures.

One of the goals of this library is to feel as idomatic in go as it can. Forced boxing of the values is alliviated by using reflection to call functions of the appropriate type where appropriate.

The APIs of the various implementations can be considered stable. Only extensions will be made to them.

Getting started

go get jsouthworth.net/go/immutable

Usage

The full documentation is available at jsouthworth.net/go/immutable

License

This project is licensed under the MIT License - see LICENSE

Acknowledgments

  • The Clojure project's implementation of these structures heavily influenced this implementation.
  • Might's blog regarding the Red/Black tree was the source of inspiration for the treemap implementation.

TODO

  • Performance benchmarking and improvements. Performance is acceptable but can problably be made better.
  • Add JSON marshalling support.

Directories

Path Synopsis
Package hashmap implements a persistent HAMT based hashmap.
Package hashmap implements a persistent HAMT based hashmap.
Package hashset implements an immutable Set datastructure on top of hashmap
Package hashset implements an immutable Set datastructure on top of hashmap
Package list implements a persistent linked list.
Package list implements a persistent linked list.
Package queue implements a persistent FIFO queue.
Package queue implements a persistent FIFO queue.
Package stack implements a persistent stack.
Package stack implements a persistent stack.
Package treemap implements a persistent Red/Black tree.
Package treemap implements a persistent Red/Black tree.
Package treeset implements an immutable Set datastructure on top of treemap
Package treeset implements an immutable Set datastructure on top of treemap
Package vector implements a Radix Balanced trie based vector.
Package vector implements a Radix Balanced trie based vector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL