Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Provides data types and functions pertaining to locations in accordance with the ICAO 4444 edition 2016 standard.
- data Aerodrome
- data Bearing
- data Distance
- data Latitude
- data Longitude
- data PointNameCode
- data GeographicPosition = GeographicPosition {}
- data BearingDistancePosition = BearingDistancePosition {}
- data SignificantPoint
- aerodromeParser :: Parser Aerodrome
- significantPointParser :: Parser SignificantPoint
- parseAerodrome :: String -> Either Error Aerodrome
- parseSignificantPoint :: String -> Either Error SignificantPoint
- mkAerodrome :: MonadFail m => String -> m Aerodrome
- mkCodedDesignator :: MonadFail m => String -> m SignificantPoint
- mkPosition :: MonadFail m => Float -> Float -> m SignificantPoint
- mkBearingDistance :: MonadFail m => String -> Int -> Int -> m SignificantPoint
Data
the name of an aerodrome, 4 uppercase characters.
Bearing in degrees magnetic, in range [0 .. 359].
Distance in nautical miles, always positive.
Latitude in decimal degrees, in range [-90 .. 90].
Longitude in decimal degrees, in range [-180 .. 180].
data PointNameCode Source #
5 letters pronounceable 'name-code' (5LNC) to designate a Significant Point.
data GeographicPosition Source #
Position expressed by the decimal latitude and longitude.
data BearingDistancePosition Source #
Position expressed as a bearing and distance from a reference point.
data SignificantPoint Source #
a significant point
CodedDesignator PointNameCode | Point coded designator (e.g. |
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
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.