{-# LANGUAGE GADTs #-}
module Duckling.Temperature.Helpers
( isLatent
, withUnit
) where
import Data.Maybe
import Prelude
import Duckling.Dimensions.Types
import qualified Duckling.Temperature.Types as TTemperature
import Duckling.Temperature.Types (TemperatureData(..))
import Duckling.Types hiding (isLatent)
isLatent :: Predicate
isLatent (Token Temperature TemperatureData{TTemperature.unit = Nothing}) =
True
isLatent _ = False
withUnit :: TTemperature.TemperatureUnit -> TemperatureData -> TemperatureData
withUnit u td = td {TTemperature.unit = Just u}