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