Last active
February 21, 2018 09:43
-
-
Save markwithers/c17f198e1c4551540788cc44d704d3bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const r = require('ramda') | |
const lefts = r.reduce( | |
(memo, either) => { | |
let extract | |
either.bimap(x => extract = x, r.identity) | |
return extract ? r.append(extract, memo) : memo | |
}, | |
[] | |
) | |
const rights = r.reduce( | |
(memo, either) => { | |
let extract | |
either.bimap(r.identity, x => extract = x) | |
return extract ? r.append(extract, memo) : memo | |
}, | |
[] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment