We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've been trying to make a csv that has run time generated columns.
I'm doing this with my type:
data MyType = MyType { callId :: UUID.UUID , agentDisplayName :: Text , callLabels :: Vector (Maybe Text) } deriving (Generic, Show, Eq)
But I just can't make an instance of Csv.ToField (Vector (Maybe Text))
Csv.ToField (Vector (Maybe Text))
I then tried to have a custom Csv.ToNamedRecord instance and do
Csv.ToNamedRecord
instance Csv.ToNamedRecord MyType where toNamedRecord CallReportCSV {..} = do Csv.namedRecord ["callId" .= callId , "Agent Display Name" ] <> Csv.namedRecord (V.toList (convertToListFunc <$> callLabels) :: [(ByteString, ByteString)])
but then the instance for Csv.DefaultOrdered fails as I can't get at the vector as headerOrder needs to be headerOrder _:
Csv.DefaultOrdered
headerOrder
headerOrder _
instance Csv.DefaultOrdered MyType where headerOrder MyType{..} = ...
Is this the expected behaviour?
I've also tried with Map a a & [a] 😄
Map a a
[a]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've been trying to make a csv that has run time generated columns.
I'm doing this with my type:
But I just can't make an instance of
Csv.ToField (Vector (Maybe Text))
I then tried to have a custom
Csv.ToNamedRecord
instance and dobut then the instance for
Csv.DefaultOrdered
fails as I can't get at the vector asheaderOrder
needs to beheaderOrder _
:Is this the expected behaviour?
I've also tried with
Map a a
&[a]
😄The text was updated successfully, but these errors were encountered: