<div dir="ltr">i wasnt aware of such guidelines for the libraries list<div><br></div><div>constrained monads/ functors are still an area of study / experimentation, they need experimentation and more community knowledge before they land in base for core type classes</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 27, 2017 at 8:37 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Off-list: Repeating what Eric Mertens said does not contribute to the discussion. Perhaps you can offer an answer to my follow-up question to him.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Jul 27, 2017 8:26 PM, "Carter Schonwald" <<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">agreed.<div><br></div><div>this needs to be tested out in a user space lib first.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 27, 2017 at 7:35 PM, Eric Mertens <span dir="ltr"><<a href="mailto:emertens@gmail.com" target="_blank">emertens@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would prefer to see designs for something like this explored in a separate package before we worried about changing base’s Foldable class.<br>
<div class="m_-8278737232165804042m_3477688207882777531HOEnZb"><div class="m_-8278737232165804042m_3477688207882777531h5"><br>
> On Jul 27, 2017, at 3:45 PM, David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>> wrote:<br>
><br>
> The Foldable class offers the method<br>
><br>
>  elem :: Eq a => a -> t a -> Bool<br>
><br>
> Unfortunately, this is really awful for sets, hash maps, etc. See<br>
> <a href="https://stackoverflow.com/questions/45361801/implement-an-olog-n-foldable-elem-for-binary-search-trees-in-haskell#45362110" rel="noreferrer" target="_blank">https://stackoverflow.com/ques<wbr>tions/45361801/implement-an-ol<wbr>og-n-foldable-elem-for-binary-<wbr>search-trees-in-haskell#453621<wbr>10</a><br>
> for an example. We could fix it, kinda:<br>
><br>
> class Foldable t where<br>
>  type ElemConstr t :: * -> Constraint<br>
>  type ElemConstr t = Eq<br>
><br>
>  elem :: ElemConstr t a => a -> t a -> Bool<br>
>  default elem :: (ElemConstr t ~ Eq, Eq a) => a -> t a -> Bool<br>
><br>
> One might legitimately complain that such a wild type is ad hoc, but<br>
> one might counter that complaint by saying that most of Foldable is<br>
> already ad hoc.<br>
><br>
> David<br>
> ______________________________<wbr>_________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/libraries</a><br>
<br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/libraries</a><br>
<br></blockquote></div></div>
</div></div></blockquote></div><br></div>