halprin / rangechain Goto Github PK
View Code? Open in Web Editor NEWChain together lazily computed modifications to range-able containers in GoLang. E.g., slices, arrays, maps, and channels.
Home Page: https://halprin.io
License: MIT License
Chain together lazily computed modifications to range-able containers in GoLang. E.g., slices, arrays, maps, and channels.
Home Page: https://halprin.io
License: MIT License
Transition to generics when Go 1.18 comes out.
Add support to start a chain from a channel. Also add support for flattening a channel. Also add support for terminating in a channel.
Currently returning a function that subsequently returns next items. Try returning a channel so we can use range
on it and write to the channel in the middle of a method.
If an error
is encountered in a function passed into the chain, what do you do with it? You can't return it currently. Well, lets make it so that an error
can be returned. Then, any terminating method also returns an error
and/or add an Error()
method that returns an error
iff any of those previous chain methods returned an error
. This would require the error
to be persisted across the the chains if it was generated in an earlier link.
Add Reduce
support.
Add Reverse
support.
Add support to start a chain from a map. Also add support for flattening maps. Also add support for terminating in a map (maybe we don't make this and just tell people to use Reduce
?).
Current implementation runs synchronously. Investigate making the links run in parallel.
Delete the code associated with the channel version of the rangechain.
Add code documentation for all of the methods such that it works in https://pkg.go.dev/.
We have other packages that are only meant to be used internally, but there is nothing to stop external users from using them though. Try these options...
internal
package at the top level, and move the intermediate
, generator
, and helper
packages under it. One thing to check, though, is how intermediate
will work if it is in internal
. How does Link
operate? Can an external user still reference that struct? Can an external user even invoke any methods on Link
? It's possible it operates similar to an unexported struct that is returned from a constructor function where you can call is methods but can't pass it around into another function because you can't reference the type. Also consider how documentation works because you want godoc
documentation to show up for Link
. You might need apply the below option just for Link
. And MapTuple
.rangechain
package. This will truly hide everything a way from external users. Perhaps chain parts of the go source code with _
. E.g. internal_helper_set.go
or some sort.Add Sum
support.
Add support to start a chain from an array (already support the slice). Also add support for flattening arrays. Also add support for terminating in an array.
Add Min
support.
Allow a range chain to start from a custom generator.
Add Sort
support.
Rename this repository to something like range-chain
and rename the top-level package something like rangechain
. Maybe make the name of the repository also be rangechain
so there isn't a difference.
Add Max
support.
Fill out the README.md
. Take inspiration from my Python version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.