structs

module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0

README

Data Structs with Go (1.18+) Generics

Go Version GoDoc License Go Report Card

Go report card has no idea how to handle Go 1.18. 😀

All structures make judicious use of generics and implement the same json.AsJSON interface (and others) making them much more consumable and shareable.

Design Decisions

  • Why no linked-list or queue? Because they are fulfilled by QStack and Node.

  • Decided to drop async walks of Node. It's easily accomplished by enclosing whatever channel is needed in the iterator function and forking a goroutine off from within it.

  • Don't stutter. tree.Tree was changed to tree.E and qstack.QStack was changed to qstack.QS to follow the idiomatic "don't stutter" design preferred by core Go libraries like testing.T. (We don't want to be another context.Context.)

TODO

  • Add equivalent methods to Node from JavaScript (InsertAfter, etc.)
  • Add Union and other set methods

Directories

Path Synopsis
set
text/set
Package set provides structs, functions, and methods for dealing with sets composed of strings (or things that can be converted to strings).
Package set provides structs, functions, and methods for dealing with sets composed of strings (or things that can be converted to strings).

Jump to

Keyboard shortcuts

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