jord-1.0.0.0: Geographical Position Calculations

Copyright(c) 2020 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, nautical miles or feet.

Synopsis

The Length type

data Length Source #

A length with a resolution of 1 micrometre.

Instances
Eq Length Source # 
Instance details

Defined in Data.Geo.Jord.Length

Methods

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

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

Ord Length Source # 
Instance details

Defined in Data.Geo.Jord.Length

Read Length Source #

See lengthP.

Instance details

Defined in Data.Geo.Jord.Length

Show Length Source #

Length is shown in metres when absolute value is <= 10 km and in kilometres otherwise.

Instance details

Defined in Data.Geo.Jord.Length

Quantity Length Source #

Add/Subtract Lengths.

Instance details

Defined in Data.Geo.Jord.Length

Smart constructors

feet :: Double -> Length Source #

Length from given amount of feet.

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

lengthP :: ReadP Length Source #

Parses and returns a Length formatted as (-)float[m|km|nm|ft]. e.g. 3000m, 2.5km, -154nm or 10000ft.

readLength :: String -> Maybe Length Source #

Reads an a Length from the given string using lengthP.

Conversions

toFeet :: Length -> Double Source #

toFeet l converts l to feet.

toKilometres :: Length -> Double Source #

toKilometres l converts l to kilometres.

toMetres :: Length -> Double Source #

toMetres l converts l to metres.

toMillimetres :: Length -> Double Source #

toMillimetres l converts l to millimetres.

toNauticalMiles :: Length -> Double Source #

toNauticalMiles l converts l to nautical miles.