-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reducer built-ins #143
Comments
|
Yes, I think we should also add mappable/functor (aliased). This proposal defines "foldable", "reducer", "iterator" and "iterable" (just in case the last two aren't defined yet — they're ES2015 built-in interfaces. |
I'm on the fence. The ECMAScript spec does not capitalize these kinds of types, though they do capitalize all the built-in constructors. Should we follow the same convention? I have been lowercasing all types that are NOT built-in constructors, except for actually, I think the idea to alias "Functor" is probably a bad one. I'd rather reserve that for the higher-kinded type constructor, e.g.: map = (a => b) => Functor(a) => Functor(b) |
I don't have an opinion on this new builtin but it should match our builtin types if its addition is warranted.
|
OK, I'm on board. Capitalize all the things! |
You should propose these aliases separately; keep it simple for now.
I find this confusing; a lot of people think of fold as an alias of reduce. |
Anything that can be iterated can also be reduced. You just have to bring your own
Oops. Can't leave it off, or it won't work for transducers or a pure |
Related: #120 |
I use reducers all the time, and frequently use type parameters in documentation named "reducer", and "foldable". It would probably be a good idea to formally define them.
Example
Mappable
Change IterableObject to Iterable
I know it's a breaking change, but AFAIK, there's not a lot of software relying on this, yet.
The text was updated successfully, but these errors were encountered: