From 1a251d8e4207594448db547dfa3c9fb96e0226b4 Mon Sep 17 00:00:00 2001 From: Bartosz Nitka Date: Wed, 15 Mar 2017 07:57:36 -0700 Subject: [PATCH] Use HashMap.lookupDefault Summary: This is a small stylystic improvement. Reviewed By: patapizza Differential Revision: D4713463 fbshipit-source-id: 47720d3 --- Duckling/Core.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duckling/Core.hs b/Duckling/Core.hs index df216bde..8d0d8437 100644 --- a/Duckling/Core.hs +++ b/Duckling/Core.hs @@ -45,7 +45,7 @@ import Duckling.Types makeReftime :: HashMap Text TimeZoneSeries -> Text -> UTCTime -> DucklingTime makeReftime series tz utcTime = DucklingTime $ ZoneSeriesTime ducklingTime tzs where - tzs = fromMaybe (TimeZoneSeries utc []) $ HashMap.lookup tz series + tzs = HashMap.lookupDefault (TimeZoneSeries utc []) tz series ducklingTime = toUTC $ utcToLocalTime' tzs utcTime -- | Builds a `DucklingTime` for timezone `tz` at current time.