Replies: 2 comments
-
Hey, would there be any interest in looking into this? If not, we can close the discussion :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
hello! thanks for your interest! we're currently not sure this falls in the scope of the library right, but we're keeping that idea in mind. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks for the great library.
I would like to propose adding in an implementation of
NonEmptyArray
to the core library. For repositories with thenoUncheckedIndexedAccess
flag enabled in the typescript compiler, it can generally be a bit of a hassle to work with arrays, especially when we can guarantee that the array isNonEmpty
.NonEmptyArrays
can be represented using :I propose we implement a
NonEmptyArray
backed by native arrays. For the most part, we can drop to using native functions where possible, but simply cast the result to theNonEmptyArray
type where it can be guaranteed. ( For example,map
,head
,last
,sort
,reverse
,concat
, etc... )Additional Reading :
https://typelevel.org/cats/datatypes/nel.html
https://docs.rs/nonempty/latest/nonempty/
I'm happy to help contribute to this piece if there is sufficient interest :)
Beta Was this translation helpful? Give feedback.
All reactions