Skip to content

Commit 5e91316

Browse files
Merge pull request #128 from sanctuary-js/davidchambers/type-idents
[email protected]
2 parents 0c530b3 + a571e17 commit 5e91316

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"types"
2020
],
2121
"dependencies": {
22-
"sanctuary-type-identifiers": "2.0.1"
22+
"sanctuary-type-identifiers": "3.0.0"
2323
},
2424
"ignore": [
2525
"/.circleci/",

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
};
224224
}
225225

226-
TypeClass['@@type'] = 'sanctuary-type-classes/TypeClass@1';
226+
TypeClass.prototype['@@type'] = 'sanctuary-type-classes/TypeClass@1';
227227

228228
// data Location = Constructor | Value
229229

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test": "npm run lint && sanctuary-test && npm run doctest"
1616
},
1717
"dependencies": {
18-
"sanctuary-type-identifiers": "2.0.1"
18+
"sanctuary-type-identifiers": "3.0.0"
1919
},
2020
"devDependencies": {
2121
"fantasy-land": "4.0.1",

test/Lazy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ function Lazy(f) {
1111
this.run = f;
1212
}
1313

14-
Lazy['@@type'] = 'sanctuary-type-classes/Lazy@1';
15-
1614
Lazy[FL.of] = function(a) {
1715
return Lazy (function() { return a; });
1816
};
1917

18+
Lazy.prototype['@@type'] = 'sanctuary-type-classes/Lazy@1';
19+
2020
Lazy.prototype[FL.map] = function(f) {
2121
return Z.ap (Z.of (Lazy, f), this);
2222
};

test/List.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ function _List(tag, head, tail) {
2222
}
2323
}
2424

25-
List['@@type'] = 'sanctuary-type-classes/List@1';
26-
2725
// Nil :: List a
2826
var Nil = List.Nil = new _List ('Nil');
2927

@@ -39,6 +37,8 @@ List[FL.of] = function(x) { return Cons (x, Nil); };
3937

4038
List[FL.zero] = List[FL.empty];
4139

40+
List.prototype['@@type'] = 'sanctuary-type-classes/List@1';
41+
4242
List.prototype[FL.equals] = function(other) {
4343
return this.isNil ?
4444
other.isNil :

test/Sum.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function Sum(value) {
1212
this.value = value;
1313
}
1414

15-
Sum['@@type'] = 'sanctuary-type-classes/Sum@1';
16-
1715
Sum[FL.empty] = function() { return Sum (0); };
1816

17+
Sum.prototype['@@type'] = 'sanctuary-type-classes/Sum@1';
18+
1919
Sum.prototype[FL.equals] = function(other) {
2020
return Z.equals (this.value, other.value);
2121
};

test/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ test ('Setoid', function() {
319319
eq (Z.Setoid.test (''), true);
320320
eq (Z.Setoid.test ([]), true);
321321
eq (Z.Setoid.test ({}), true);
322-
eq (Z.Setoid.test ({'@@type': 'my-package/Quux@1'}), true);
322+
eq (Z.Setoid.test ({'@@type': 'my-package/Quux@1'}), false);
323323
});
324324

325325
test ('Ord', function() {
@@ -668,8 +668,9 @@ test ('equals', function() {
668668
eq (Z.equals (Math.sin, Math.cos), false);
669669
eq (Z.equals (Identity (Identity (Identity (0))), Identity (Identity (Identity (0)))), true);
670670
eq (Z.equals (Identity (Identity (Identity (0))), Identity (Identity (Identity (1)))), false);
671-
eq (Z.equals ({'@@type': 'my-package/Quux@1'}, {'@@type': 'my-package/Quux@1'}), true);
671+
eq (Z.equals ({'@@type': 'my-package/Quux@1'}, {'@@type': 'my-package/Quux@1'}), false);
672672
eq (Z.equals (Array.prototype, Array.prototype), true);
673+
delete Maybe['@@type'];
673674
eq (Z.equals (Nothing.constructor, Maybe), true);
674675
eq (Z.equals ((Just (0)).constructor, Maybe), true);
675676
eq (Z.equals (Lazy$of (0), Lazy$of (0)), false);

0 commit comments

Comments
 (0)