From cae11ace6105091af41e773cc44b7a72704728d5 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Wed, 1 May 2024 10:12:51 -0500 Subject: [PATCH] fix: more bugs --- src/Data.CSV.Record.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data.CSV.Record.purs b/src/Data.CSV.Record.purs index efd51eb..64d35d0 100644 --- a/src/Data.CSV.Record.purs +++ b/src/Data.CSV.Record.purs @@ -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