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

'decodeByName' require same number of rows? #162

Open
tom-bop opened this issue Jul 27, 2018 · 0 comments
Open

'decodeByName' require same number of rows? #162

tom-bop opened this issue Jul 27, 2018 · 0 comments

Comments

@tom-bop
Copy link

tom-bop commented Jul 27, 2018

With too many columns, decodeByName silently throws away the extra columns:

>  decodeByName "a,b,c\n1,2,3,4" :: Either String (Header, V.Vector (HM.HashMap String String))
Right (["a","b","c"],[fromList [("a","1"),("b","2"),("c","3")]])

It also happily parses a row with too few:

>  decodeByName "a,b,c\n1,2" :: Either String (Header, V.Vector (HM.HashMap String String))
Right (["a","b","c"],[fromList [("a","1"),("b","2")]])

Is there (or should there be) a parsing mode which requires the same number of columns per row as there are header rows? There seems to be support from the spec:

Each line should contain the same number of fields throughout the file.

https://tools.ietf.org/html/rfc4180

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

No branches or pull requests

1 participant