fix: more bugs

This commit is contained in:
orion 2024-05-01 10:02:36 -05:00
parent f2e2b4b9c8
commit a17f0774f6
Signed by: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ workspace:
- aff: ">=7.1.0 <8.0.0"
- arrays: ">=7.3.0 <8.0.0"
- bifunctors: ">=6.0.0 <7.0.0"
- control
- control: ">=6.0.0 <7.0.0"
- datetime: ">=6.1.0 <7.0.0"
- effect: ">=4.0.0 <5.0.0"
- either: ">=6.1.0 <7.0.0"
@ -24,7 +24,7 @@ workspace:
- node-streams: ">=9.0.0 <10.0.0"
- nullable: ">=6.0.0 <7.0.0"
- numbers: ">=9.0.1 <10.0.0"
- ordered-collections
- ordered-collections: ">=3.2.0 <4.0.0"
- precise-datetime: ">=7.0.0 <8.0.0"
- prelude: ">=6.0.1 <7.0.0"
- record: ">=4.0.0 <5.0.0"

View File

@ -112,8 +112,8 @@ foreach stream cb = whileJust do
-- | - All records have been processed (`Node.Stream.closed` is `true`)
read :: forall @r rl a. RowToList r rl => ReadCSVRecord r rl => CSVParser r a -> Effect (Maybe { | r })
read stream = runMaybeT do
raw :: Array String <- MaybeT $ Nullable.toMaybe <$> readImpl stream
cols <- MaybeT $ getOrInitColumnsMap stream
raw :: Array String <- MaybeT $ Nullable.toMaybe <$> readImpl stream
liftEither $ lmap (error <<< show) $ runExcept $ readCSVRecord @r @rl cols raw
-- | Collect all parsed records into an array