fix: more bugs

This commit is contained in:
orion 2024-05-01 10:12:51 -05:00
parent 70d6ed44f6
commit cae11ace61
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -40,7 +40,7 @@ instance (RowToList r (Cons k v tailrl), IsSymbol k, ReadCSV v, Lacks k tail, Co
let
k = reflectSymbol (Proxy @k)
pos <- liftMaybe (pure $ ForeignError $ "row too long; did not expect value " <> k) $ Map.lookup k cols
valraw <- liftMaybe (pure $ ForeignError "unexpected end of record") $ Array.index vals pos
let valraw = fromMaybe "" $ Array.index vals pos
val <- readCSV @v valraw
tail <- readCSVRecord @tail @tailrl cols (fromMaybe [] $ Array.deleteAt pos vals)
pure $ Record.insert (Proxy @k) val tail