Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module shadows names of some units previously defined in
Types
.
Therefore, the units from that module must be used qualified by module.
Synopsis
- data ContextualDistance
- = Nonrelatable
- | ContextualDistance Double DeferrableUnit
- toSystemUnit :: Unit -> DeferrableUnit
- toRawUnit :: DeferrableUnit -> Unit
Documentation
data ContextualDistance Source #
Supports deferred resolution of ambiguous units. Note that this sum type cannot be simply replaced by "Maybe (ContextualDistance Double DeferrableUnit)" (with Nothing representing Nonrelatable). See "NOTE A" below.
Nonrelatable | If two different ambiguous units were to be composed, then it would not be possible to decide which to resolve to. As of today, this won't happen since for now M is the lone ambiguous unit. |
ContextualDistance Double DeferrableUnit |
Instances
Semigroup ContextualDistance Source # | When both Metric and Imperial units are given, resolve to Metric. Otherwise, preserve the original measurement system and use the smaller unit. For the purpose of this resolution, all Metric units are considered "smaller" than Imperial units. |
Defined in Duckling.DistanceUnits.Types (<>) :: ContextualDistance -> ContextualDistance -> ContextualDistance # sconcat :: NonEmpty ContextualDistance -> ContextualDistance # stimes :: Integral b => b -> ContextualDistance -> ContextualDistance # |
toSystemUnit :: Unit -> DeferrableUnit Source #
Disambiguation of original Unit type