{"repo":"BooleanCat/go-functional","free":true,"listed":false,"github":"https://github.com/BooleanCat/go-functional","clone":"git clone https://github.com/BooleanCat/go-functional.git","description":"go-functional is a library of iterators to augment the standard library","language":"Go","stars":537,"topics":["go","golang","functional-programming"],"license":"MIT","category":"dev-tools","readme_excerpt":"Functional Programming in Go A library of iterators for use with iter.Seq. Requires Go 1.23+. Reference documentation Installation Overview Most functions offered by this package are either consumers or iterators. Consumers will iterate over an iterator and completely or partially drain them of values and (in most cases) collect the values into a data type. Iterators are functions that yield new values and can be ranged over. See Go's documentation for iterators for more details. Consumers The standard libary provides functions to collect iterators in the slices and maps packages that should satisfy most cases where collection is needed. This package provides additional collection methods and makes existing consumers from the standard library chainable. [!WARNING] Attempting to collect infinite iterators will cause an infinite loop and likely deadlock. Consider bounding infinite iterators before collect (for example using Take). All & Any All will return true if all values yielded by an iterator are true , or false otherwise. Iteration will terminate early if false is encountered. Empty iterators will return true . Any will return true if any value yielded by an iterator is true , or false otherwise. Iteration will terminate early if true is encountered. Empty iterators will return false . [!NOTE] The itx package does not contain All or Any due to limitations with Go's type system. Collect In most cases slices.Collect from the standard library may be used to collect items fro","default_branch":null,"files":null,"tree":[],"storefront":"/r/BooleanCat","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/BooleanCat/go-functional/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}