Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanctuary-type-identifiers@3.0.0 #128

Merged
merged 1 commit into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This delete statement is required to prevent Maybe from being treated as a member of a type that lacks a fantasy-land/equals method. I will remove it when I upgrade the sanctuary-maybe dependency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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