iter: Generic, lazy iterators for Go 1.18

This page summarizes the projects mentioned and recommended in the original post on /r/golang

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. iter

    Discontinued Package iter provides generic, lazy iterators, functions for producing them from primitive types, as well as functions and methods for transforming and consuming them. (by mtoohey31)

    The reason why I decided on the inner/outer architecture was because interface objects can't be used as recievers to methods (as far as I understand). As a result, my initial implementation, which didn't have this structure, was limited to functions instead of methods, which made code where iterator methods were chained extremely unreadable, since it was difficult to tell which order they were being applied in. It's a tradeoff, but I think the readability might be worth it. Do you have any ideas for alternative workarounds?

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. go

    The Go programming language

    Also, can anyone explain the error "instantiation cycle" to me? I have two methods commented for which this was occuring: Position in iter.go, and ZipEndo in zip.go, and I'm not sure what this error means, or why it occurs, since the corresponding function implementation (Zip) of ZipEndo has no such problem. I don't believe it's an implementation bug in the tuple package, since I was originally using my own simple 2-value tuple struct and the exact same error ocurred. The only thing I can find about it online is this post, but I'm not sure how the answer there applies to either of my cases...

  4. gtools

    Generic tools for go 1.18+

    Looks good Do you benchmark it vs for loop? Recently I am wrote pretty similar lib but using functions for all(filter, ForEach etc): gtools Maybe you will find something for yours lib

  5. go-iterator

    Discontinued Go 1.18 generics iterator experiment

    Regarding call chaining, it is still possible to chain things with operations that return different types, but they have to be done with functions instead of methods, so the result is still the same, just it's a little less readable. There is a generic iterator implementation by polyfloyd that doesn't support method chaining, but imo being able to chain iterators is one of their biggest strengths, since implementing lazy evaluation manually for a single operation isn't that difficult, its when you need to perform multiple kinds of manipulations that it gets messy.

  6. go-generic

    A collection of experiments using Go Generics coming out in Go 1.18

    I did some experimenting of my own and came up with this design: https://github.com/qualidafial/go-generic/tree/master/iter

  7. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

Did you know that Go is
the 4th most popular programming language
based on number of references?