Skip to content

Commit

Permalink
Merge pull request #134 from gabejohnson/add-symbol
Browse files Browse the repository at this point in the history
types: add Symbol
  • Loading branch information
davidchambers authored Apr 14, 2017
2 parents 85ec900 + 29243be commit 2189b6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,11 @@
//. Type comprising every primitive String value.
var String_ = NullaryTypeWithUrl('String', typeofEq('string'));

//# Symbol :: Type
//.
//. Type comprising every Symbol value.
var Symbol_ = NullaryTypeWithUrl('Symbol', typeofEq('symbol'));

//# Type :: Type
//.
//. Type comprising every `Type` value.
Expand Down Expand Up @@ -779,6 +784,7 @@
//. - <code><a href="#RegExp">RegExp</a></code>
//. - <code><a href="#StrMap">StrMap</a>(<a href="#Unknown">Unknown</a>)</code>
//. - <code><a href="#String">String</a></code>
//. - <code><a href="#Symbol">Symbol</a></code>
//. - <code><a href="#Undefined">Undefined</a></code>
var env = [
AnyFunction,
Expand All @@ -793,6 +799,7 @@
RegExp_,
StrMap(Unknown),
String_,
Symbol_,
Undefined
];

Expand Down Expand Up @@ -2447,6 +2454,7 @@
RegexFlags: RegexFlags,
StrMap: fromUncheckedUnaryType(StrMap),
String: String_,
Symbol: Symbol_,
Undefined: Undefined,
Unknown: Unknown,
ValidDate: ValidDate,
Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,11 @@ describe('def', function() {
eq($.String.url, 'https://github.com/sanctuary-js/sanctuary-def/tree/v' + version + '#String');
});

it('provides the "Symbol" type', function() {
eq($.Symbol.name, 'Symbol');
eq($.Symbol.url, 'https://github.com/sanctuary-js/sanctuary-def/tree/v' + version + '#Symbol');
});

it('provides the "Undefined" type', function() {
eq($.Undefined.name, 'Undefined');
eq($.Undefined.url, 'https://github.com/sanctuary-js/sanctuary-def/tree/v' + version + '#Undefined');
Expand Down

0 comments on commit 2189b6f

Please sign in to comment.