on master help sign in
Finish switching over to '_Tuple' format for tuples.
commit1fcb01f74335c709c3f83067c80ca7310affb85c authorEvan Czaplicki <evan@Evans-MacBook-Air.local> dateMon 15 Jul 2013, 01:05 (13 years ago) parent0070a84
3 files changed+7−7
libraries/Native/Show.js+2−2 libraries/Native/Utils.js+4−4 runtime/Render/Element.js+1−1
libraries/Native/Show.js+2−2
@@ -37,7 +37,7 @@ Elm.Native.Show = function(elm) {
3737 if (output.length === 0) return "{}";
3838 return "{ " + output.join(", ") + " }";
3939 } else if (typeof v === "object" && 'ctor' in v) {
40− if (v.ctor.substring(0,5) === "Tuple") {
40+ if (v.ctor.substring(0,6) === "_Tuple") {
4141 var output = [];
4242 for (var k in v) {
4343 if (k === 'ctor') continue;
@@ -63,7 +63,7 @@ Elm.Native.Show = function(elm) {
6363 var cons = F3(function(k,v,acc){return NList.Cons(Tuple2(k,v),acc)});
6464 var list = A3(Dict.foldr, cons, NList.Nil, v);
6565 var name = "Dict";
66− if (list.ctor === "::" && list._0._1.ctor === "Tuple0") {
66+ if (list.ctor === "::" && list._0._1.ctor === "_Tuple0") {
6767 name = "Set";
6868 list = A2(List.map, function(x){return x._0}, list);
6969 }
libraries/Native/Utils.js+4−4
@@ -36,8 +36,8 @@ Elm.Native.Utils = function(elm) {
3636 }
3737 }
3838
39− if (x.ctor.slice(0,5) === 'Tuple') {
40− var n = x.ctor.slice(5) - 0;
39+ if (x.ctor.slice(0,6) === '_Tuple') {
40+ var n = x.ctor.slice(6) - 0;
4141 var err = 'cannot compare tuples with more than 6 elements.';
4242 if (n === 0) return EQ;
4343 if (n >= 1) { ord = cmp(x._0, y._0); if (ord !== EQ) return ord;
@@ -55,8 +55,8 @@ Elm.Native.Utils = function(elm) {
5555 }
5656
5757
58− var Tuple0 = { ctor: "Tuple0" };
59− function Tuple2(x,y) { return { ctor:"Tuple2", _0:x, _1:y } }
58+ var Tuple0 = { ctor: "_Tuple0" };
59+ function Tuple2(x,y) { return { ctor:"_Tuple2", _0:x, _1:y } }
6060
6161 var count = 0;
6262 function guid(_) { return count++ }
runtime/Render/Element.js+1−1
@@ -21,7 +21,7 @@ function setProps(props, e) {
2121 a.appendChild(e);
2222 return a;
2323 }
24− if (props.hover.ctor !== 'Tuple0') {
24+ if (props.hover.ctor !== '_Tuple0') {
2525 var overCount = 0;
2626 e.addEventListener('mouseover', function() {
2727 if (overCount++ > 0) return;