Skip to content
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

Review of Functional Programming section #148

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Commits on Oct 1, 2024

  1. fix bug in C++ calc_min_max example (#134)

    By starting the reduction with a (0, 0) tuple, the function returned
    an incorrect minimum of zero if all inputs were positive or an incorrect
    maximum of zero if all inputs were negative.
    
    The new version assumes that the `data` vector is not empty, which is
    always the case here but might not be in real life. I think that's fine
    for an example.
    
    I also swapped `std::reduce` for `std::accumulate` to be more
    consistent with the rest of the text. It's sequential by default,
    and we're still providing an initial element, so I think it's
    strictly equivalent in this case, but I haven't tested it.
    nicolaspayette committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    8705604 View commit details
    Browse the repository at this point in the history
  2. swap std::reduce for std::accumulate in sum of squares ex. (#134)

    Again, for consistency with the rest of the text.
    
    I also believe it's strictly equivalent here, but it might be worth
    double-checking.
    nicolaspayette committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    89e9ddd View commit details
    Browse the repository at this point in the history
  3. tweak higher_order_function_cpp text (#134)

    including adding hyphens to "higher-order functions"
    nicolaspayette committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    965d564 View commit details
    Browse the repository at this point in the history
  4. remove 2nd intentional bug in Python's Game of Life impl. (#134)

    Feel free to overrule me on this, but it felt very ad hoc to me and was
    not present in the C++ version.
    nicolaspayette committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    05b11e6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a83efab View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    826e0cd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6d107fb View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    13591db View commit details
    Browse the repository at this point in the history