You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have found NonEmptyList from the Scala Cats library very useful in the past. I'd like to implement a similar collection type in Expression. Is this something you would be open to @dbrattli ?
Describe the solution you'd like
Just a few examples outlined below. Overall I'd see it working in a similar way to expression.collections.Block (i.e. an immutable collection).
list(NonEmptyList.one(1)) == [1]
list(NonEmptyList.of(1, 2, 3)) == [1, 2, 3]
NonEmptyList.from([1, 2, 3]).map(list) ==Some([1, 2, 3])
NonEmptyList.from([]) ==Nothingdefdo_something_with_list_that_must_be_non_empty(l: NonEmptyList):
# do things with elements in `l`
Describe alternatives you've considered
Doing this everywhere in your code:
defdo_something_with_list_that_must_be_non_empty(l: list):
ifl:
# do things with elements in `l`
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I have found
NonEmptyList
from the Scala Cats library very useful in the past. I'd like to implement a similar collection type in Expression. Is this something you would be open to @dbrattli ?Describe the solution you'd like
Just a few examples outlined below. Overall I'd see it working in a similar way to
expression.collections.Block
(i.e. an immutable collection).Describe alternatives you've considered
Doing this everywhere in your code:
The text was updated successfully, but these errors were encountered: