Aeromess-0.1.0.0: Aeronautical Messages parsers and formatters

Safe HaskellSafe
LanguageHaskell2010

Data.Icao.Location

Contents

Description

Provides data types and functions pertaining to locations in accordance with the ICAO 4444 edition 2016 standard.

Synopsis

Data

data Aerodrome Source #

the name of an aerodrome, 4 uppercase characters.

data Bearing Source #

Bearing in degrees magnetic, in range [0 .. 359].

data Distance Source #

Distance in nautical miles, always positive.

data Latitude Source #

Latitude in decimal degrees, in range [-90 .. 90].

data Longitude Source #

Longitude in decimal degrees, in range [-180 .. 180].

data PointNameCode Source #

5 letters pronounceable 'name-code' (5LNC) to designate a Significant Point.

data BearingDistancePosition Source #

Position expressed as a bearing and distance from a reference point.

Constructors

BearingDistancePosition 

Fields

data SignificantPoint Source #

a significant point

Constructors

CodedDesignator PointNameCode

Point coded designator (e.g. RASMU), 2 to 5 characters.

Position GeographicPosition

Point Position; latitude and longitude in decimal degrees.

BearingDistance BearingDistancePosition

Bearing and distance from a reference point, bearing in degrees, distance in nautical miles.

Parsers

parseAerodrome :: String -> Either Error Aerodrome Source #

Parses the given textual representation of an Aerodrome. return either an Error (Left) or the parsed Aerodrome (Right).

parseSignificantPoint :: String -> Either Error SignificantPoint Source #

Parses the given textual representation of a SignificantPoint. return either an Error (Left) or the parsed SignificantPoint (Right).

Smart constructors

mkAerodrome :: MonadFail m => String -> m Aerodrome Source #

Aerodrome smart constructor. Fails if the given name is not a valid.

mkCodedDesignator :: MonadFail m => String -> m SignificantPoint Source #

CodedDesignator SignificantPoint smart constructor. Fails if the given name is not a valid.

mkPosition :: MonadFail m => Float -> Float -> m SignificantPoint Source #

Position SignificantPoint smart constructor. Fails if the given latitude and/or longitude are not valid.

mkBearingDistance :: MonadFail m => String -> Int -> Int -> m SignificantPoint Source #

BearingDistance SignificantPoint smart constructor. Fails if the given name andor bearing andor distance are not a valid.