-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Replace Type constructors in env with actual Types #354
Conversation
test/env.js
Outdated
var eq = require('./internal/eq'); | ||
|
||
|
||
var $Type = $.NullaryType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if sanctuary-def
exports Type
, so I don't have to create it myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we name this Type
rather than $Type
? Regardless, let's add a type signature. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
If |
Could you update this pull request's destination branch to the temporary |
test/env.js
Outdated
var $ = require('sanctuary-def'); | ||
var type = require('sanctuary-type-identifiers'); | ||
|
||
var eq = require('./internal/eq'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's group the imports like so:
var $ = require('sanctuary-def');
var type = require('sanctuary-type-identifiers');
var S = require('..');
var eq = require('./internal/eq');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
test/env.js
Outdated
test('env', function() { | ||
|
||
eq(typeof S.env, 'object'); | ||
eq($.test([], $.Array($Type), S.env), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an elegant assertion!
test/env.js
Outdated
var $Type = $.NullaryType( | ||
'sanctuary/Type', | ||
'', | ||
function(x) { return type(x) === 'sanctuary-def/Type'; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider using S.type
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
Based on sanctuary-js/sanctuary-def#123
This fixes the inconsistent type of
env
, allowing it to be passed into$.test
. We should release this as a patch.