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

Implements flatmap #44792

Merged
merged 14 commits into from
Apr 7, 2022
Merged

Implements flatmap #44792

merged 14 commits into from
Apr 7, 2022

Commits on Apr 5, 2022

  1. Configuration menu
    Copy the full SHA
    49e0cfc View commit details
    Browse the repository at this point in the history
  2. Implements flatmap and iteration methods for Some and Nothing

    flatmap is the composition of map and flatten. It is important for functional programming patterns.
    
    Some tasks that can be easily attained with list-comprehensions, including the composition of filter and mapping, or flattening a list of computed lists, can only be attained with do-syntax style if a flatmap functor is available. (Or appending a `|> flatten`, etc.)
    
    Filtering can be implemented by outputing empty lists or singleton lists for the values to be removed or kept. A more proper approach would be the optional monad, though, usually implemented in Julia as a union of Some and Nothing.
    
    This patch therefore also implements iteration methods for Some and Nothing, to enable the filtermap pattern with flatmap.
    nlw0 committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    69f4bd8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1b005a9 View commit details
    Browse the repository at this point in the history
  4. docstring fix

    nlw0 committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    f2f1523 View commit details
    Browse the repository at this point in the history
  5. docstring fix

    nlw0 committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    dde1f9c View commit details
    Browse the repository at this point in the history
  6. Moved astuple to base/tuple.jl

    nlw0 committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    a53a103 View commit details
    Browse the repository at this point in the history
  7. Added a second test for flatmap

    nlw0 committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    ddda481 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    38fa2e3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a69552f View commit details
    Browse the repository at this point in the history
  10. Removing monuple

    nlw0 committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    5bff01b View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2022

  1. Update base/iterators.jl

    Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
    nlw0 and tkf authored Apr 6, 2022
    Configuration menu
    Copy the full SHA
    e73af27 View commit details
    Browse the repository at this point in the history
  2. Update base/iterators.jl

    Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
    nlw0 and tkf authored Apr 6, 2022
    Configuration menu
    Copy the full SHA
    e9947bc View commit details
    Browse the repository at this point in the history
  3. Update base/iterators.jl

    Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
    nlw0 and tkf authored Apr 6, 2022
    Configuration menu
    Copy the full SHA
    705017f View commit details
    Browse the repository at this point in the history
  4. Update base/iterators.jl

    Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
    nlw0 and tkf authored Apr 6, 2022
    Configuration menu
    Copy the full SHA
    a720be0 View commit details
    Browse the repository at this point in the history