Aeromess-0.1.0.0: Aeronautical Messages parsers and formatters

Safe HaskellSafe
LanguageHaskell2010

Data.Icao.Time

Contents

Description

Provides data types and functions pertaining to time, duration and dates in accordance with the ICAO 4444 edition 2016 standard.

Synopsis

Data

data Hhmm Source #

Hhmm represents a time or duration expressed with hours and minutes only in the range 0000 .. 2359.

Instances

Eq Hhmm Source # 

Methods

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

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

Show Hhmm Source # 

Methods

showsPrec :: Int -> Hhmm -> ShowS #

show :: Hhmm -> String #

showList :: [Hhmm] -> ShowS #

data DayTime Source #

day and time.

data Date Source #

Date represents a date expressed zith year, month and day.

Instances

Eq Date Source # 

Methods

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

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

Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Parsers

parseHhmm :: String -> Either Error Hhmm Source #

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

parseDate :: String -> Either Error Date Source #

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

parseDayTime :: String -> Either Error DayTime Source #

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

Smart constructors

mkHhmm :: MonadFail m => Int -> Int -> m Hhmm Source #

Hhmm smart constructor. Fails if given hour and/or minute are not valid.

mkDate :: MonadFail m => Int -> Int -> Int -> m Date Source #

Date smart constructor. Fails if given year andor month andor day are not valid.

mkDayTime :: MonadFail m => Int -> Int -> Int -> m DayTime Source #

DayTime smart constructor. Fails if given day andor hour andor minute are not valid.