aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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