Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fails to parse data with custom delimiter #2

Shimuuar opened this Issue · 3 comments

2 participants


I tried to use custom delimiter but cassava fails to parse data. Here is test case

{-# LANGUAGE OverloadedStrings #-}
import Data.Csv

import qualified Data.ByteString.Lazy as BS
import Data.Vector (Vector)

txt :: BS.ByteString
txt = "first second third"

n = 32 -- or space

notOK :: Either String (Vector (String,String,String))
notOK = decodeWith (defaultDecodeOptions{decDelimiter = n}) txt

Result fo decoding is:

Left "conversion error: cannot unpack array of length 1 into a 3-tuple. Input record: fromList [\"first second third\"]"

As spaces are allowed unquoted in fields as per RFC 4180 they cannot be used as delimiters as it makes parsing ambiguous. I will update the docs to clarify that point.


Same thing for tabs.


That sounds wrong. I will investigate and write a test to make sure it work in the future. Custom parsing options is probably the least well-tested part of the code.

@tibbe tibbe closed this in 743d226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.