|
|
|
|
|
by dasyatidprime
64 days ago
|
|
The NonEmptyList in Cats is a product (struct/tuple) type, though; I assume the Haskell version is the same. The type shown in the blog post is a sum (union) type which can contain an empty enumerable, which contradicts the name OneOrMore. The use described for the type in the post (basically a convenience conversion funnel) is different and makes sense in its own right (though it feels like kind of a weak use case). I'm not sure what a good name would've been illustratively that would've been both accurate and not distracting, though. |
|
They could’ve done the Either type which would’ve been more correct or maybe EitherT (if the latter is even possible)