Skip to content

Commit

Permalink
Merge pull request #128 from sanctuary-js/davidchambers/type-idents
Browse files Browse the repository at this point in the history
sanctuary-type-identifiers@3.0.0
  • Loading branch information
davidchambers authored Nov 3, 2019
2 parents 0c530b3 + a571e17 commit 5e91316
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"types"
],
"dependencies": {
"sanctuary-type-identifiers": "2.0.1"
"sanctuary-type-identifiers": "3.0.0"
},
"ignore": [
"/.circleci/",
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
};
}

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

// data Location = Constructor | Value

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test": "npm run lint && sanctuary-test && npm run doctest"
},
"dependencies": {
"sanctuary-type-identifiers": "2.0.1"
"sanctuary-type-identifiers": "3.0.0"
},
"devDependencies": {
"fantasy-land": "4.0.1",
Expand Down
4 changes: 2 additions & 2 deletions test/Lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ function Lazy(f) {
this.run = f;
}

Lazy['@@type'] = 'sanctuary-type-classes/Lazy@1';

Lazy[FL.of] = function(a) {
return Lazy (function() { return a; });
};

Lazy.prototype['@@type'] = 'sanctuary-type-classes/Lazy@1';

Lazy.prototype[FL.map] = function(f) {
return Z.ap (Z.of (Lazy, f), this);
};
Expand Down
4 changes: 2 additions & 2 deletions test/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ function _List(tag, head, tail) {
}
}

List['@@type'] = 'sanctuary-type-classes/List@1';

// Nil :: List a
var Nil = List.Nil = new _List ('Nil');

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

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

List.prototype['@@type'] = 'sanctuary-type-classes/List@1';

List.prototype[FL.equals] = function(other) {
return this.isNil ?
other.isNil :
Expand Down
4 changes: 2 additions & 2 deletions test/Sum.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ function Sum(value) {
this.value = value;
}

Sum['@@type'] = 'sanctuary-type-classes/Sum@1';

Sum[FL.empty] = function() { return Sum (0); };

Sum.prototype['@@type'] = 'sanctuary-type-classes/Sum@1';

Sum.prototype[FL.equals] = function(other) {
return Z.equals (this.value, other.value);
};
Expand Down
5 changes: 3 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ test ('Setoid', function() {
eq (Z.Setoid.test (''), true);
eq (Z.Setoid.test ([]), true);
eq (Z.Setoid.test ({}), true);
eq (Z.Setoid.test ({'@@type': 'my-package/Quux@1'}), true);
eq (Z.Setoid.test ({'@@type': 'my-package/Quux@1'}), false);
});

test ('Ord', function() {
Expand Down Expand Up @@ -668,8 +668,9 @@ test ('equals', function() {
eq (Z.equals (Math.sin, Math.cos), false);
eq (Z.equals (Identity (Identity (Identity (0))), Identity (Identity (Identity (0)))), true);
eq (Z.equals (Identity (Identity (Identity (0))), Identity (Identity (Identity (1)))), false);
eq (Z.equals ({'@@type': 'my-package/Quux@1'}, {'@@type': 'my-package/Quux@1'}), true);
eq (Z.equals ({'@@type': 'my-package/Quux@1'}, {'@@type': 'my-package/Quux@1'}), false);
eq (Z.equals (Array.prototype, Array.prototype), true);
delete Maybe['@@type'];
eq (Z.equals (Nothing.constructor, Maybe), true);
eq (Z.equals ((Just (0)).constructor, Maybe), true);
eq (Z.equals (Lazy$of (0), Lazy$of (0)), false);
Expand Down

0 comments on commit 5e91316

Please sign in to comment.