Skip to content

Add transpose to Data.Array #226

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

Merged
merged 3 commits into from
Jul 28, 2022
Merged

Conversation

newlandsvalley
Copy link
Contributor

Description of the change

It seems to be a good idea to add transpose to Data.Array given that we have it already in Data.List. This is discussed in #225. The implementation was actually provided by @JordanMartinez for which many thanks.

I've slotted the code towards the end of the section marked transformations.


Checklist:

  • Added the change to the changelog's "Unreleased" section
  • Linked to issue transpose? #225
  • Documentation style is basically the same as for Data.List.transpose
  • Tests basically identical to those for Data.List.transpose

Implementation courtesy of Jordan Martinez.
Copy link
Contributor

@JordanMartinez JordanMartinez left a comment

Choose a reason for hiding this comment

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

I'm guessing NonEmptyArray also doesn't have transpose? Maybe that should be added as well. But, that can be done in a separate PR if you don't feel like doing it here.

@JordanMartinez
Copy link
Contributor

🏓 @garyb Can this get an approval?

Copy link
Member

@garyb garyb left a comment

Choose a reason for hiding this comment

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

👍

@newlandsvalley
Copy link
Contributor Author

And NonEmptyList does not seem to have transpose either. I suspect the main difficulty might be in writing terse documentation because constructing a NonEmptyArray is so awkward. Maybe this is why this module is so lightly documented anyway. Could we get away with a statement that says something like behaviour as for Array.transpose?

@JordanMartinez JordanMartinez merged commit e5d80f3 into purescript:master Jul 28, 2022
@JordanMartinez JordanMartinez mentioned this pull request Aug 8, 2022
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