I would be interested in using this lib, thought about writing something alike after reading this article (which is very nice!).
But your naming puts me off a bit. All these cryptic "nel"s :)
Wouldn't it by nicer to have something like:
nonEmptyListOf()
toNonEmptyList()
- etc
It's not much longer than what we already have in stdlib, like linkedMapOf, mutableSetOf which are of similar length.
Or even like in Haskell/PureScript: drop List from the end: nonEmptyOf(), etc. Though this would require having NonEmpty<T> instead of NonEmptyList<T> for symmetry.
I would be interested in using this lib, thought about writing something alike after reading this article (which is very nice!).
But your naming puts me off a bit. All these cryptic "nel"s :)
Wouldn't it by nicer to have something like:
nonEmptyListOf()toNonEmptyList()It's not much longer than what we already have in stdlib, like
linkedMapOf,mutableSetOfwhich are of similar length.Or even like in Haskell/PureScript: drop
Listfrom the end:nonEmptyOf(), etc. Though this would require havingNonEmpty<T>instead ofNonEmptyList<T>for symmetry.