jord-0.2.0.0: Geographical Position Calculations

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

Data.Geo.Jord.Length

Contents

Description

Types and functions for working with (signed) lengths in metres, kilometres or nautical miles.

Synopsis

The Length type

data Length Source #

A length with a resolution of 1 millimetre.

Instances
Eq Length Source # 
Instance details

Defined in Data.Geo.Jord.Length

Methods

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

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

Read Length Source #

See readLength.

Instance details

Defined in Data.Geo.Jord.Length

Show Length Source #

Length is shown in metres when <= 10,000 m and in kilometres otherwise.

Instance details

Defined in Data.Geo.Jord.Length

Quantity Length Source #

Add/Subtract Length.

Instance details

Defined in Data.Geo.Jord.Length

Smart constructors

kilometres :: Double -> Length Source #

Length from given amount of kilometres.

metres :: Double -> Length Source #

Length from given amount of metres.

nauticalMiles :: Double -> Length Source #

Length from given amount of nautical miles.

Read

readLength :: String -> Length Source #

Obtains a Length from the given string formatted as (-)float[m|km|nm] - e.g. 3000m, 2.5km or -154nm.

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

readLengthF :: MonadFail m => String -> m Length Source #

Same as readLength but returns a MonadFail.

Conversions

toKilometres :: Length -> Double Source #

toKilometres l converts l to kilometres.

toMetres :: Length -> Double Source #

toMetres l converts l to metres.

toNauticalMiles :: Length -> Double Source #

toNauticalMiles l converts l to nautical miles.

Misc.

isZero :: Length -> Bool Source #

Is given Length == 0?