Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data Distance
- meters :: Double -> Distance
- centimeters :: Double -> Distance
- millimeters :: Double -> Distance
- kilometers :: Double -> Distance
- toMeters :: Distance -> Double
- toCentimeters :: Distance -> Double
- toMillimeters :: Distance -> Double
- toKilometers :: Distance -> Double
Documentation
An abstract distance. Use the provided smart constructors to create
a meaningful distance. Note that on first sight a Num
instance might
seem desirable, but this would defeat the purpose of having transparent
and explicitly constructed distances due to fromInteger
.
centimeters :: Double -> Distance Source #
millimeters :: Double -> Distance Source #
kilometers :: Double -> Distance Source #
toCentimeters :: Distance -> Double Source #
toMillimeters :: Distance -> Double Source #
toKilometers :: Distance -> Double Source #