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

Add Nel APIs shorthand #3480

Closed
wants to merge 2 commits into from
Closed

Conversation

T45K
Copy link

@T45K T45K commented Aug 23, 2024

there is no shorthand of NonEmtpyList APIs while there is Nel, shorthand of NonEmptyList itself.

in this PR, i added three APIs:

  • nelOf: shorthand of nonEmptyListOf
  • toNelOrNull: shorthand of toNonEmptlyListOrNull
  • toNelOrOptional: shorthand of toNonEmptyListOrOptional

@serras
Copy link
Member

serras commented Aug 23, 2024

I am not sure of how useful this is: the longer names are much clearer to everybody reading, and if you are using an IDE, I'm not sure how many keystrokes you really save.

The only shorthand we have now is EitherNel, but here the main goal is to get rid of the nesting (Either<NonEmptyListOf<...>>) than the name per se.

@T45K
Copy link
Author

T45K commented Aug 23, 2024

thank you for checking this PR

i added them because long API name sometimes make a length of single line long, and then hard to read (at least for me).
i define such shorthands in my project by myself, but need to define them repeatedly in different projects. it is tired task.
so i'd be happy if arrow.kt itself provided those shorthands...

if you don't agree with my idea, please close this PR...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants