More Data.Set and Data.Map operations

David Feuer david.feuer at gmail.com
Sun Aug 7 19:29:49 UTC 2016


On Aug 7, 2016 3:22 PM, "Jan-Willem Maessen" <jmaessen at alum.mit.edu> wrote:
> Are there good examples of increasing / decreasing predicates that don't
embed a split element?  Because split already gives the results you want.

An obvious one is

isRight :: Either a b -> Bool.

Another is

fst :: (Bool, a) -> Bool

> There's a pretty large combinatorial space of these functions – I'm not
sure Data.Map and Data.Set should fill that entire space with
individually-named functions.
>
> The applicative versions suggest there might want to be an
applicative-friendly version of mergeWithKey, but again it's not obvious we
need the 32767 different combinations of individual functions.

Indeed, that is cause for concern. I wrote another email suggesting a
combinator subsuming several of these using a GADT to deal with the type
equalities some of them require.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160807/eb81629c/attachment.html>


More information about the Libraries mailing list