Closed akhra closed 5 years ago
I'm overall -1 here. I tried the route of using lots of non-standard typeclasses in a prelude with classy-prelude. rio is explicitly about taking standard approaches, and Witherable doesn't seem to be well accepted right now. This can introduce some confusing error messages for people.
rio is explicitly about taking standard approaches, Witherable doesn't seem to be well accepted right now.
Fair enough -- I was leaning on "non-controversial" but I see the value of a higher adoption bar. Closing for now, if Witherable
gathers momentum I might re-open later.
In a similar vein to #172: the
witherable
package provides typeclass-based implementations ofcatMaybes
,mapMaybe
andfilter
, as well aswither
which is semanticallyfmap catMaybes . traverse
. It has no dependencies not already present in Rio; and in contrast to concerns on #172, performance should be no worse and possibly better than low-hanging alternatives.It is actively maintained and current in Stackage. Its immediate Hackage reverse dependency list is short, but notably includes
reflex
. I haven't seen any competing conceptualizations (though I haven't looked hard for them either).The big advantage of adopting this here is having generalized versions of these functions in the prelude, with no need for import qualification or hiding.