/go2-generic-containers

Some container data structures written in the next generation of Golang with generics

Primary LanguageGoMIT LicenseMIT

Go2 Generic Containers

This is a repo to implement some data structures in go's generic syntax. The go generic is actually under development and the draft design can be found here.

Since the design might be subject to change, this repo will be updated accordingly.

Supported Containers

Test Script

My merged test script can be found in this go2go-playground.

Note that at this time, the go2go playground is the only platform that to run go-generic-style code...

TODO

More data structures

  • Red Black Tree
  • SortedMap and SortedSet (need benchmark of AVL Tree and Red Black Tree to decide which one to use)
  • OrderedSet

Package structure

Since the go2go-playground is the only way to write go-generic-style code, writing everything in the same package will be much easier to merge them into a single file and do testing there. The package structure is subject to change after the generic feature is released.

Format

go fmt is not available at this time, as the generic syntax will be recognized as syntax error. The code format will be articulated after the geenric feature is released.