Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/DataFrame/IO/CSV.hs
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,9 @@ getRowAsText df i = V.ifoldr go [] (columns df)
++ "the other columns at index "
++ show i
go k (OptionalColumn (c :: V.Vector (Maybe a))) acc = case c V.!? i of
Just e -> textRep : acc
where
textRep = case testEquality (typeRep @a) (typeRep @T.Text) of
Just Refl -> fromMaybe "Nothing" e
Nothing -> (T.pack . show) e
Just e -> case testEquality (typeRep @a) (typeRep @T.Text) of
Just Refl -> fromMaybe T.empty e : acc
Nothing -> maybe T.empty (T.pack . show) e : acc
Nothing ->
error $
"Column "
Expand Down
8 changes: 3 additions & 5 deletions src/DataFrame/Lazy/IO/CSV.hs
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,9 @@ getRowAsText df i = V.ifoldr go [] (columns df)
++ "the other columns at index "
++ show i
go k (OptionalColumn (c :: V.Vector (Maybe a))) acc = case c V.!? i of
Just e -> textRep : acc
where
textRep = case testEquality (typeRep @a) (typeRep @T.Text) of
Just Refl -> fromMaybe "Nothing" e
Nothing -> (T.pack . show) e
Just e -> case testEquality (typeRep @a) (typeRep @T.Text) of
Just Refl -> fromMaybe T.empty e : acc
Nothing -> maybe T.empty (T.pack . show) e : acc
Nothing ->
error $
"Column "
Expand Down