-
Notifications
You must be signed in to change notification settings - Fork 265
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
Update official docs #491
Update official docs #491
Conversation
def do_laundry(clothes): | ||
wet_clothes = wash(clothes, coins) | ||
dry_clothes = dry(wet_clothes, coins) | ||
wet_clothes = wash(clothes) | ||
dry_clothes = dry(wet_clothes) | ||
return fold(dry_clothes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the presence of coins
is somewhat antithetical to the principal of function purity as described in the docs.
>>> double = partial(mul, 2) # Partial evaluation | ||
>>> doubled = double(2) # Currying | ||
>>> doubled = double(5) # Currying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the choice of passing in 2
might be slightly confusing for some people given the function itself is called double
.
@@ -38,7 +38,7 @@ These functions correspond to the SQL commands ``SELECT`` and ``WHERE``. | |||
... map(get([1, 2])), | |||
... list) | |||
|
|||
Note: this uses the `curried`_ versions of ``map`` and ``filter``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -89,7 +89,7 @@ groups. | |||
'M': [(2, 'Bob', 200, 'M'), (3, 'Charlie', 150, 'M'), (4, 'Dennis', 50, 'M')]} | |||
|
|||
>>> valmap(compose(sum, pluck(2)), | |||
... _) | |||
... _) # The underscore captures results from the previous prompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be obvious to everyone.
@@ -2,7 +2,7 @@ Tips and Tricks | |||
=============== | |||
|
|||
Toolz functions can be combined to make functions that, while common, aren't | |||
a part of toolz's standard library. This section presents | |||
a part of toolz's standard offerings. This section presents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid confusion with the python standard library.
This looks great! Thanks so much @zzhengnan! Sorry for the delay. I'm striving to be more responsive towards |
@eriknw Thanks for the review! |
This PR contains
I'll push the generated docs once the RST changes are considered LGTM.