jord-0.5.0.0: Geographical Position Calculations

Copyright(c) 2018 Cedric Liegeois
LicenseBSD3
MaintainerCedric Liegeois <ofmooseandmen@yahoo.fr>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Geo.Jord.Speed

Contents

Description

Types and functions for working with speed in metres per second, kilometres per hour, miles per hour, knots or feet per second.

Synopsis

The Speed type

data Speed Source #

A speed with a resolution of 1 millimetre per hour.

Instances
Eq Speed Source # 
Instance details

Defined in Data.Geo.Jord.Speed

Methods

(==) :: Speed -> Speed -> Bool #

(/=) :: Speed -> Speed -> Bool #

Read Speed Source #

See readSpeed.

Instance details

Defined in Data.Geo.Jord.Speed

Show Speed Source #

Speed is shown in kilometres per hour.

Instance details

Defined in Data.Geo.Jord.Speed

Methods

showsPrec :: Int -> Speed -> ShowS #

show :: Speed -> String #

showList :: [Speed] -> ShowS #

Quantity Speed Source #

Add/Subtract Speed.

Instance details

Defined in Data.Geo.Jord.Speed

Smart constructors

metresPerSecond :: Double -> Speed Source #

Speed from given amount of metres per second.

kilometresPerHour :: Double -> Speed Source #

Speed from given amount of kilometres per hour.

milesPerHour :: Double -> Speed Source #

Speed from given amount of miles per hour.

knots :: Double -> Speed Source #

Speed from given amount of knots.

feetPerSecond :: Double -> Speed Source #

Speed from given amount of feet per second.

Read

readSpeed :: String -> Speed Source #

Obtains a Speed from the given string formatted as (-)float[ms|kmh|mph|kt] - e.g. 300ms, 250kmh, -154mph, 400kt or 100ft/s.

This simply calls read s :: Speed so error should be handled at the call site.

readSpeedF :: MonadFail m => String -> m Speed Source #

Same as readSpeed but returns a MonadFail.

Conversions

toMetresPerSecond :: Speed -> Double Source #

toMetresPerSecond s converts s to metres per second.

toKilometresPerHour :: Speed -> Double Source #

toKilometresPerHour s converts s to kilometres per hour.

toMilesPerHour :: Speed -> Double Source #

toMilesPerHour s converts s to miles per hour.

toKnots :: Speed -> Double Source #

toKnots s converts s to knots.

toFeetPerSecond :: Speed -> Double Source #

toFeetPerSecond s converts s to feet per second.