【文件属性】:
文件名称:fpGo:Monad,用于Golang的函数式编程功能
文件大小:18KB
文件格式:ZIP
更新时间:2021-05-09 03:48:02
golang monads reactive collection stream
fpGo
Monad,用于Golang的函数式编程功能
为什么
我喜欢函数式编程,Rx样式编码和Optional用法。
但是,很难在Golang中实现它们,并且很少有库可以实现其中的一部分。
因此,我实现了fpGo。 我希望你会喜欢:)
特征
可选/也许
像Rx的Monad
发行人
模式匹配
FP功能
类似于Java8Stream的集合
类似于PythonicGenerator的协程(yield / yieldFrom)
用法
可选(IsPresent / IsNil,或Let)
var m MaybeDef
var orVal int
var boolVal bool
// IsPresent(), IsNil()
m = Maybe . Just ( 1 )
boolVal = m . IsPresent () // true
boolVal = m . IsNil () /
【文件预览】:
fpGo-master
----.travis.yml(421B)
----handler.go(1KB)
----fp.go(9KB)
----monadIO.go(2KB)
----publisher.go(2KB)
----maybe_test.go(7KB)
----monadIO_test.go(614B)
----LICENSE(1KB)
----glide.lock(480B)
----cor.go(4KB)
----publisher_test.go(1KB)
----stream.go(5KB)
----fp_test.go(4KB)
----glide.yaml(117B)
----stream_test.go(4KB)
----.gitignore(210B)
----go.sum(521B)
----cor_test.go(2KB)
----README.md(4KB)
----maybe.go(8KB)
----go.mod(236B)
----Gopkg.toml(741B)
----Gopkg.lock(748B)