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
Support Objects aka dictionaries as Traversables #3448
base: master
Are you sure you want to change the base?
Conversation
Coverage> ramda@0.29.1 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register
�[2J�[1;3H
1188 passing (894ms)
=============================== Coverage summary ===============================
Statements : 94.03% ( 2474/2631 )
Branches : 85.73% ( 967/1128 )
Functions : 93.24% ( 552/592 )
Lines : 94.31% ( 2320/2460 )
================================================================================ |
Coverage> ramda@0.29.1 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register
�[2J�[1;3H
1188 passing (861ms)
=============================== Coverage summary ===============================
Statements : 94.03% ( 2474/2631 )
Branches : 85.73% ( 967/1128 )
Functions : 93.24% ( 552/592 )
Lines : 94.31% ( 2320/2460 )
================================================================================ |
I'm in favor of this, but maybe not before 1.0 |
TLDR: You can shoot yourselves in the foot with JavaScript, why not with Ramda too? I just found #2580 which dealt basically with the same problem 6 years ago. That is really upsetting. That PR got bikeshedded discussing the incompatibility of I guess people have moved on, since still today I cannot traverse a dictionary So if PRs don't cut it, perhaps Ramda has hit an implicit barrier in supporting certain FP features? The low entry barrier and no hand-holding attitude have been always the strengths of Ramda: You can solve problems quickly using
out of personal frustration: |
I hear you. As I said and as I argued in those earlier threads, I 100% think we should add Traversable for objects. But it does not feel right to me to have it 1.0, and I worry we'll get into another endless bikeshed if we try. But we'll get to 1.0, and I think soon. I like getting |
🤔 Plain objects are inherently treated as Functors for Seems reasonable to give the same support for Traversables, IMO Additionally, Data.Map implements Traversable and it does exactly what is being asked here |
As implemented elsewhere:
S.sequence
andS.traverse
which work onObject
Map
type of Prof. Frisby's FP GuideRecord
type of fp-ts