aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2026-04-16 01:24:22 +0200
committerstuebinm2026-04-16 01:24:22 +0200
commit4cc892fd4fdf93dded8edfda444a39409e4d1f9d (patch)
tree878d57637d0434bde3910be173ff783135a13093
parent5f27e441f47f2565b941b321a9939d54357e1654 (diff)
gtfs: be more lenient about some fields
-rw-r--r--lib/GTFS.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/GTFS.hs b/lib/GTFS.hs
index 4f3a311..bec519f 100644
--- a/lib/GTFS.hs
+++ b/lib/GTFS.hs
@@ -405,10 +405,10 @@ instance CSV.FromNamedRecord ShapePoint where
intAsBool :: CSV.NamedRecord -> BS.ByteString -> CSV.Parser (Maybe Bool)
intAsBool r field = do
- int <- r .: field
- pure $ case int :: Int of
- 1 -> Just True
- 0 -> Just False
+ int <- r .:? field
+ pure $ case int :: Maybe Int of
+ Just 1 -> Just True
+ Just 0 -> Just False
_ -> Nothing
intAsBool' :: CSV.NamedRecord -> BS.ByteString -> CSV.Parser Bool