<div dir="ltr">Another funny thing:<div><div>1> {A,B} = {sets:from_list([-28]), sets:from_list([4])}.</div><div>{{set,1,16,16,8,80,48,</div><div> {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},</div><div> {{[],[],[],[],[],[],[],[],[],[],[],[],[-28],[],[],[]}}},</div><div> {set,1,16,16,8,80,48,</div><div> {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},</div><div> {{[],[],[],[],[],[],[],[],[],[],[],[],[4],[],[],[]}}}}</div><div>2> sets:union(A,B) == sets:union(B,A).</div><div>false</div></div><div><br></div><div>Thomas Arts (of QuickCheck fame) showed this in 2005 I think!</div><div>This is due to the sets underlying representation.</div><div>I thought there was a PR to use maps instead but can't find it anymore.</div><div><br></div><div>The corresponding PropEr property:</div><div><div>-include_lib("proper/include/proper.hrl").</div></div><div><div>a_sets_generator() -></div><div> ?LET(SomeList, list(integer())</div><div> ,sets:from_list(SomeList)</div><div> ).</div><div>%% rebar3 as test proper -p prop_sets_union_is_commutative<br></div><div>prop_sets_union_is_commutative() -></div><div> ?FORALL({SetA,SetB}, {a_sets_generator(),a_sets_generator()}</div><div> ,?WHENFAIL(io:format("\nSetA = ~w\nSetB = ~w\n", [sets:to_list(SetA), sets:to_list(SetB)])</div><div> ,sets:union(SetA,SetB) =:= sets:union(SetB,SetA)</div><div> )</div><div> ).</div></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><br></div><div>Cheers,</div><div>-- </div><div>Pierre Fenoll</div></div><div><br></div></div></div></div>
<br><div class="gmail_quote">On 24 April 2018 at 17:15, Brujo Benavides <span dir="ltr"><<a href="mailto:elbrujohalcon@gmail.com" target="_blank">elbrujohalcon@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 style="word-wrap:break-word;line-break:after-white-space">Hi John,<div><br></div><div><span class="m_7294545298002479637Apple-tab-span" style="white-space:pre-wrap"> </span>See here: <a href="https://medium.com/erlang-battleground/the-asymmetry-of-validations-1ccdf2457293" target="_blank">https://medium.com/<wbr>erlang-battleground/the-<wbr>asymmetry-of-validations-<wbr>1ccdf2457293</a></div><div><br></div><div><span class="m_7294545298002479637Apple-tab-span" style="white-space:pre-wrap"> </span>Hope this helps :)<br><div>
<div style="color:rgb(0,0,0);font-family:'Trebuchet MS';font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><span id="m_7294545298002479637docs-internal-guid-e691a4cc-056a-0210-b8b7-ea8d87d888ad"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><br class="m_7294545298002479637Apple-interchange-newline"><hr></span></span><div><b><i><a href="http://about.me/elbrujohalcon" target="_blank">Brujo Benavides</a></i></b></div></div></div><div style="color:rgb(0,0,0);font-family:'Trebuchet MS';font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><b><br></b></div><br class="m_7294545298002479637Apple-interchange-newline">
</div>
<div><br><blockquote type="cite"><div><div class="h5"><div>On 24 Apr 2018, at 12:13, John Doe <<a href="mailto:donpedrothird@gmail.com" target="_blank">donpedrothird@gmail.com</a>> wrote:</div><br class="m_7294545298002479637Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr">Hi,<div>is this normal?</div><div><br></div><div><div>{some,term} = [] ++ {some, term}. %% list vanishes</div><div><br></div><div>[1,2,3|{some,term}] = [1,2,3] ++ {some, term}. %% improper list</div></div></div></div></div>
______________________________<wbr>_________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br></div></blockquote></div><br></div></div><br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>