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

Merge Merge/MergeBy/MergeJoinBy implementations (v2) #736

Merged
merged 5 commits into from
Sep 20, 2023

Commits on Sep 16, 2023

  1. MergeJoinBy alias of new InternalMergeJoinBy

    And the trait `OrderingOrBool<L, R>` is now for wrapped functions rather than for `Ordering` and `bool`.
    
    NOTES:
    - The new struct `MergeFuncLR<F, T>` is useful to avoid conflicting implementations of `OrderingOrBool<L, R> for F` because the compiler thinks that `F` could implement both `FnMut(&L, &R) -> Ordering` and `FnMut(&L, &R) -> bool`.
    - The new trait `FuncLR<L, R>` is useful to be able to infer the Output type `T` without having to add a fourth parameter to `MergeJoinBy`. From what I understand, this is needed because the `FnMut` trait is not fully stabilized yet.
    - `OrderingOrBool<L, R>` has a new associated type `Out`, which is useful in `impl Iterator` because otherwise the compiler would complain about `T` be unconstrained.
    
    This successfully pass the tests.
    Philippe-Cholet committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    23d8346 View commit details
    Browse the repository at this point in the history
  2. Make MergeBy an alias of InternalMergeJoinBy

    Being now an alias, we can remove various implementations. `FusedIterator` will be inserted back soon.
    
    We don't need `MergePredicate<T>` anymore because we use two new implementations of `OrderingOrBool<T, T>`.
    Philippe-Cholet committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    1d0d801 View commit details
    Browse the repository at this point in the history
  3. Implement FusedIterator for InternalMergeJoinBy

    `I` and `J` are fused by `InternalMergeJoinBy` so we don't need them to implement `FusedIterator`.
    Philippe-Cholet committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    535310b View commit details
    Browse the repository at this point in the history
  4. Unalias MergeBy

    Philippe-Cholet committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    2ce8986 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. Remove OrderingOrBool::Out

    Apparently not needed anymore.
    Philippe-Cholet committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    9e267b6 View commit details
    Browse the repository at this point in the history