juniper

module
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT

README

Juniper

Go Reference Go 1.18 Go 1.19 Go 1.20 Go 1.21 Fuzz

Juniper is a library of extensions to the Go standard library using generics, including containers, iterators, and streams.

  • container/tree contains a Map and Set that keep elements in sorted order. They are implemented using a B-tree, which performs better than a binary search tree.
  • container/deque contains a double-ended queue implemented with a ring buffer.
  • container/xheap contains a min-heap similar to the standard library's container/heap but more ergonomic, along with a PriorityQueue that allows setting priorities by key.
  • container/xlist contains a linked-list similar to the standard library's container/list, but type-safe.
  • xslices contains some commonly-used slice operations, like Chunk, Reverse, Clear, and Join.
  • iterator contains an iterator interface used by the containers, along with functions to manipulate them, like Map, While, and Reduce.
  • stream contains a stream interface, which is an iterator that can fail. Useful for iterating over collections that require I/O. It has most of the same combinators as iterator, plus some extras like Pipe and Batch.
  • parallel contains some shorthand for common uses of goroutines to process slices, iterators, and streams in parallel, like parallel.MapStream.
  • xsort contains extensions to the standard library package sort. Notably, it also has the definition for xsort.Less, which is how custom orderings can be defined for sorting and also for ordered collections like from container/tree.
  • You can probably guess what's in the packages xerrors, xmath, xmath/xrand, xsync, and xtime.

Packages that overlap directly with a standard library package are named the same but with an x prefix for "extensions", e.g. sort and xsort.

See the docs for more.

Directories

Path Synopsis
Package chans contains functions for manipulating channels.
Package chans contains functions for manipulating channels.
container
deque
Package deque contains a double-ended queue.
Package deque contains a double-ended queue.
tree
Package tree contains an implementation of a B-tree Map and Set.
Package tree contains an implementation of a B-tree Map and Set.
xheap
Package xheap contains extensions to the standard library package container/heap.
Package xheap contains extensions to the standard library package container/heap.
xlist
Package xlist contains extensions to the standard library package container/list.
Package xlist contains extensions to the standard library package container/list.
internal
orderedhashmap
package orderedhashmap contains a simple and very inefficient ordered map using the map builtin for comparing against other ordered containers in tests.
package orderedhashmap contains a simple and very inefficient ordered map using the map builtin for comparing against other ordered containers in tests.
Package iterator allows iterating over sequences of values, for example the contents of a container.
Package iterator allows iterating over sequences of values, for example the contents of a container.
Package parallel provides primitives for running tasks in parallel.
Package parallel provides primitives for running tasks in parallel.
Package stream allows iterating over sequences of values where iteration may fail, for example when it involves I/O.
Package stream allows iterating over sequences of values where iteration may fail, for example when it involves I/O.
Package xerrors contains extensions to the standard library package errors.
Package xerrors contains extensions to the standard library package errors.
Package xmaps contains utilities for working with maps.
Package xmaps contains utilities for working with maps.
Package xmath contains extensions to the standard library package math.
Package xmath contains extensions to the standard library package math.
xrand
Package xrand contains extensions to the standard library package math/rand.
Package xrand contains extensions to the standard library package math/rand.
Package xslices contains utilities for working with slices of arbitrary types.
Package xslices contains utilities for working with slices of arbitrary types.
Package xsort contains extensions to the standard library package sort.
Package xsort contains extensions to the standard library package sort.
Package xsync contains extensions to the standard library package sync.
Package xsync contains extensions to the standard library package sync.
Package xtime contains extensions to the standard library package time.
Package xtime contains extensions to the standard library package time.

Jump to

Keyboard shortcuts

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