snoyberg / classy-prelude

A typeclass-based Prelude.
108 stars 15 forks source link

confusing intersect of Lists of Tuples #120

Closed trin-cz closed 8 years ago

trin-cz commented 8 years ago

I'm having a lot of fun now, with Atom IDE, Yesod, Riak and Reactive Banana. Thanks everyone, who made this possible. However ...

[(1,0)] intersect [(1,1)] [(1,0)]

This incompatibility with Data.List.intersect confused me a lot. Is it a feature?

snoyberg commented 8 years ago

The reason for this distinction is that lists of pairs are treated by the mono-traversable library as an association list, and act like Maps. The intersection is occurring only on the first value in each tuple.

On Thu, Mar 3, 2016 at 5:51 PM, Martin Taranza notifications@github.com wrote:

I'm having a lot of fun now, with Atom IDE, Yesod, Riak and Reactive Banana. Thanks everyone, who made this possible. However ...

[(1,0)] intersect [(1,1)] [(1,0)]

This incompatibility with Data.List.intersect confused me a lot. Is it a feature?

— Reply to this email directly or view it on GitHub https://github.com/snoyberg/classy-prelude/issues/120.

trin-cz commented 8 years ago

I was afraid of this. Ok, it makes sense. Thank you. Let's close this.