-
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
[email protected] compatibility #131
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var fl = require('./fl.js'); | ||
var fixedAp = function(f) { | ||
return f.ap(this); | ||
}; | ||
|
||
var patch = function(obj){ | ||
return Object.keys(fl).forEach(function(key) { | ||
if (typeof obj[key] === 'function') { | ||
if (key === 'ap') { | ||
obj[fl[key]] = fixedAp; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't feel right to me. What would be the consequences of removing this exception? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removing this means we should revert There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the way the existing |
||
} else { | ||
obj[fl[key]] = obj[key]; | ||
} | ||
} | ||
}); | ||
}; | ||
|
||
var patchAll = function(objs){ | ||
return objs.forEach(patch); | ||
}; | ||
|
||
module.exports = patchAll; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
equals: 'fantasy-land/equals', | ||
concat: 'fantasy-land/concat', | ||
empty: 'fantasy-land/empty', | ||
map: 'fantasy-land/map', | ||
ap: 'fantasy-land/ap', | ||
of: 'fantasy-land/of', | ||
reduce: 'fantasy-land/reduce', | ||
traverse: 'fantasy-land/traverse', | ||
chain: 'fantasy-land/chain', | ||
chainRec: 'fantasy-land/chainRec', | ||
extend: 'fantasy-land/extend', | ||
extract: 'fantasy-land/extract', | ||
bimap: 'fantasy-land/bimap', | ||
promap: 'fantasy-land/promap', | ||
}; |
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.
I just published v0.3.0. :)