Skip to content
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

Consider adding specific parsing #153

Open
GregorySchwartz opened this issue Aug 18, 2017 · 0 comments
Open

Consider adding specific parsing #153

GregorySchwartz opened this issue Aug 18, 2017 · 0 comments

Comments

@GregorySchwartz
Copy link

In almost every program I use cassava with, I have this definition:

parse :: [Map.Map T.Text T.Text]
parse xs = either error (V.toList . snd) (CSV.decodeByName xs :: Either String (CSV.Header, V.Vector (Map.Map T.Text T.Text)))

I know "either error" may not be that great, but can there be some convenience functions like csvToMap :: [Map.Map T.Text T.Text] and the like (for other types) to make the parser have one less point of friction if one doesn't mind an opinionated type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants