Hot take: the NonEmpty list type is less useful than it seems. Because when we need to filter we're back to a list and many functions take lists/return lists. On the other hand the implicit order of elements in a list can be much more interesting to model (see Data.List.Ordered)
-
-
Replying to @etorreborre
A couple of things that would make it more useful: * Widespread use * nonempty literals
3 replies 0 retweets 17 likes -
Replying to @runarorama @etorreborre
You are correct about filter.. Evidence: filtered is not a valid Traversal (bits missing to get to here). There are vast number of other useful operations though, and I bet they are hidden in your code! Consider: (Apply f, Profunctor p) => (p a (f b)) -> p s (f t)
1 reply 0 retweets 1 like
PS: I realised how difficult this line of reasoning is to explain on twitter as I was typing, so please accept my my "bits missing"
1:18 PM - 18 Dec 2020
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.