Skip to content

Instantly share code, notes, and snippets.

@jrsinclair
Created December 5, 2018 22:23
Show Gist options
  • Save jrsinclair/fdd3a09fa66f223fecb9da3353b7bc76 to your computer and use it in GitHub Desktop.
Save jrsinclair/fdd3a09fa66f223fecb9da3353b7bc76 to your computer and use it in GitHub Desktop.
function csvToMessages(csvData) {
const csvRows = splitCSVToRows(csvData);
const headerFields = csvRows.map(_.head).map(splitFields);
const dataRows = csvRows.map(_.tail);
const processRowsA = liftA2(processRows);
const messagesArr = processRowsA(headerFields, dataRows);
return either(showError, showMessages, messagesArr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment