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

Backport #3076 Add Align typeclass #3349

Merged
merged 4 commits into from
Mar 11, 2020

Conversation

gagandeepkalra
Copy link
Contributor

@gagandeepkalra gagandeepkalra commented Mar 8, 2020

addresses #3143

@gagandeepkalra
Copy link
Contributor Author

This was was surprisingly easier to do, though I was saving it up for last given the size.

def align[A, B](fa: Vector[A], fb: Vector[B]): Vector[A Ior B] = {
val aLarger = fa.size >= fb.size
if (aLarger) {
(fa, fb).zipped.map(Ior.both) ++ fa.drop(fb.size).map(Ior.left)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main change, inlined here

@gagandeepkalra gagandeepkalra changed the title Backport #3076 Add Align typeclass to 2.11 Backport #3076 Add Align typeclass Mar 8, 2020
Copy link
Contributor

@travisbrown travisbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@travisbrown travisbrown merged commit 0980189 into typelevel:scala_2.11 Mar 11, 2020
@gagandeepkalra gagandeepkalra deleted the backport/align branch March 11, 2020 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants