abstract

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT

README

Go Reference

Missing abstract data types for Go

We've already got generic type-safe slices and maps since Go 1.21, but we want more.

Sub packages provided here share some common patterns:

Roadmap

  • set
  • heap
  • list
  • skip list
  • ring
  • stack?
  • queue?
  • chainable maps?
  • chainable slices?

Usage

go get github.com/houz42/abstract@latest

If you want to try the experimental iterator and range func features, set environment variable GOEXPERIMENT=rangefunc before running any go command:

GOEXPERIMENT=rangefunc go install my/program
GOEXPERIMENT=rangefunc go build my/program
GOEXPERIMENT=rangefunc go test my/program
GOEXPERIMENT=rangefunc go test my/program -bench=.

See the range func wiki for more details.

Development

To develop with the experimental features, follow the gist to install gotip and least gopls and configure vs code.

Directories

Path Synopsis
Package heaps provides a heap implementation for any type.
Package heaps provides a heap implementation for any type.
Package lists is a simple wrapper to container/list which in turn implements a doubly linked list, to make it generic and type-safe.
Package lists is a simple wrapper to container/list which in turn implements a doubly linked list, to make it generic and type-safe.
Package sets defines a set type and various methods useful with set operations.
Package sets defines a set type and various methods useful with set operations.
Package skiplists implements a [skip list].
Package skiplists implements a [skip list].

Jump to

Keyboard shortcuts

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