jord-0.5.0.0: Geographical Position Calculations

Copyright (c) 2018 Cedric Liegeois BSD3 Cedric Liegeois experimental portable Safe Haskell2010

Data.Geo.Jord.Length

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 0.1 millimetre.

Instances
 Source # Instance detailsDefined in Data.Geo.Jord.Length Methods(==) :: Length -> Length -> Bool #(/=) :: Length -> Length -> Bool # Source # See readLength. Instance detailsDefined in Data.Geo.Jord.Length Methods Source # Length is shown in metres when absolute value is <= 10,000 m and in kilometres otherwise. Instance detailsDefined in Data.Geo.Jord.Length MethodsshowsPrec :: Int -> Length -> ShowS #showList :: [Length] -> ShowS # Source # Add/Subtract Lengths. Instance detailsDefined in Data.Geo.Jord.Length Methods Source # GreatArc from track, duration and earth mean radius. Instance detailsDefined in Data.Geo.Jord.Kinematics MethodsgreatArc :: (Track a, Duration, Length) -> GreatArc Source #greatArcF :: MonadFail m => (Track a, Duration, Length) -> m GreatArc Source #

# Smart constructors

Length from given amount of feet.

Length from given amount of kilometres.

Length from given amount of metres.

Length from given amount of nautical miles.

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

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

Same as readLength but returns a Either.

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

Same as readLength but returns a MonadFail.

# Conversions

toFeet l converts l to feet.

toKilometres l converts l to kilometres.

toMetres l converts l to metres.

toNauticalMiles l converts l to nautical miles.