Created
December 5, 2018 06:51
-
-
Save jrsinclair/7560421adaebb5d0b517c9963f482fa4 to your computer and use it in GitHub Desktop.
Elegant Error Handling Code Samples
This file contains 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
function processRow(headerFields, row) { | |
const fieldsEither = right(row).map(splitFields); | |
const rowObj = fieldsEither.chain(zipRow(headerFields)); | |
const rowObjWithDate = rowObj.chain(addDateStr); | |
return either(showError, rowToMessage, rowObjWithDate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment