It literally says:
> Works with JavaScript arrays
> Works with JavaScript arrays
a = [1, 2, 3];
foo = effect.Array.append(a, 4);
instead of using what's built in to the language? a = [1, 2, 3];
foo = [...a, 4];"Use when you need to guarantee a non-empty result after adding a required trailing value."
...whatever that means lol
a = [undefined];
res = a.pop() // undefined
a = [];
res = a.pop() // undefinedWithout the type there are a few possibilities: 1. I could forget the assertion and have buggy code without realizing. 2. I could ensure that all uses do the assertion. Even if we can statically know that it is empty. This costs us the check for every call of the function, and ends up being more code.
Alternatively I could statically know in advance. The code won't let me `Array.pop` because that is invalid, so:
1. I *cannot* make that mistake
2. It cost no runtime performance
3. It cost no extra code in a function
1: I say soft-enforce because if someone were to pass a value incorrectly cast as NonEmpty, it would still have a runtime error, but that is a bug elsewhere, not here.