glambda

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT

README

Quick Start

go get github.com/hyphennn/glamda@latest
package main

import (
	"fmt"

	"github.com/hyphennn/glamda/gstream"
)

func main() {
	s := []int{1, 1, 4, 5, 1, 4, 114514, 0, 0, 0}
	s2 := gstream.AsSliceStream(s).Filter(func(i int) bool {
		return i%2 == 0
	}).Convert(func(i int) int {
		return i + 1
	}).Sort(func(t1, t2 int) bool {
		return t1 < t2
	}).Collect()
	fmt.Println(s2) // [1 1 1 5 5 114515]
}

致力于构建一个 Go Stream API 以及一些常用的泛型、闭包工具,并且不引入任何第三方依赖以及过多的性能消耗

Source of inspiration: Bytedance code.byted.org.lang/gg

This package was not open source when the author resigned, and a similar repository was not found, so this package was made based on some ideas from the Java Stream API and lang/gg

致力于构建一个 Go Stream API 以及一些常用的泛型、闭包工具,并且不引入任何第三方依赖以及过多的性能消耗

灵感来源:字节跳动 code.byted.org/lang/gg

此包在作者离职时仍未开源,也未找到一个类似的仓库,因此基于 Java Stream API 以及 lang/gg 的一些思想做了此包

Directories

Path Synopsis
gcollection
disjoint-set
Package disjoint_set Author: hyphen Copyright 2022 hyphen.
Package disjoint_set Author: hyphen Copyright 2022 hyphen.
gset
Package gset Author: hyphen Copyright 2023 hyphen.
Package gset Author: hyphen Copyright 2023 hyphen.
gstack
Package gstack Author: hyphen Copyright 2024 hyphen.
Package gstack Author: hyphen Copyright 2024 hyphen.
Package gconv Author: hyphen Copyright 2023 hyphen.
Package gconv Author: hyphen Copyright 2023 hyphen.
Package gmap Author: hyphen Copyright 2023 hyphen.
Package gmap Author: hyphen Copyright 2023 hyphen.
Package gslice Author: hyphen Copyright 2023 hyphen.
Package gslice Author: hyphen Copyright 2023 hyphen.
Package gstream Author: hyphen Copyright 2023 hyphen.
Package gstream Author: hyphen Copyright 2023 hyphen.
Package gutils Author: hyphen Copyright 2023 hyphen.
Package gutils Author: hyphen Copyright 2023 hyphen.
Package gvalue Author: hyphen Copyright 2023 hyphen.
Package gvalue Author: hyphen Copyright 2023 hyphen.
Package internal Author: hyphen Copyright 2023 hyphen.
Package internal Author: hyphen Copyright 2023 hyphen.
assert
Package assert
Package assert
constraints
Package constraints defines a set of useful constraints to be used with type parameters.
Package constraints defines a set of useful constraints to be used with type parameters.

Jump to

Keyboard shortcuts

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