Hi everyone, Is there a NonEmptySet in arrow? I ca...
# arrow
b
Hi everyone, Is there a NonEmptySet in arrow? I can't find it
s
Hey Benoit,
NonEmptySet
is not in Arrow.
b
Is there any plan to add it?
s
We have such types in Refinement, and I think that’s where such type will land. Now that FIR is available from Kotlin 1.6.0-RC we’ll see Arrow Meta coming soon. So there is no plans to support it in Arrow, but the work for supporting this more ad-hoc in Kotlin is being worked on. cc\\ @raulraja
r
The Arrow Analysis plugin will be able to detect invalid accesses to indexes etc in regular sets but there is no NonEmptySet data structure. IMO this is something that we can maybe add to Arrow core if it’s a minimal impl similar to NonEmptyList
s
This should also be covered by refined types, no?
r
could be but we don’t have those types anymore in the Refined plugin. If we ship a runtime library of types it does not matter where it lives since the analysis plugin can refine the types and functions from arrow too in an
arrow-laws
module as we have now one for the std lib. In whatever case if the type is interesting we can add it there or in core wherever makes the most sense.
👍 1
b
What is Refinement? I google it but the documentation doesn't say much about it
s
Here is some documentation about what the goals are, but it’s still WIP.
Here is a Scala library with the same goal, but it will probably have a completely different DSL/API. https://github.com/fthomas/refined
b
Thanks!