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.Duration

Contents

Description

Types and functions for working with (signed) durations.

Synopsis

The Duration type

data Duration Source #

A duration with a resolution of 1 millisecond.

toMilliseconds :: Duration -> Int Source #

the number of milliseconds in duration.

Smart constructors

milliseconds :: Double -> Duration Source #

Duration from given amount of milliseconds.

hours :: Double -> Duration Source #

Duration from given amount of hours.

minutes :: Double -> Duration Source #

Duration from given amount of minutes.

seconds :: Double -> Duration Source #

Duration from given amount of seconds.

hms :: Int -> Int -> Double -> Duration Source #

Duration from hours minutes and decimal seconds.

Conversions

toHours :: Duration -> Double Source #

toHours d gets the number of hours in d.

toMinutes :: Duration -> Double Source #

toMinutes d gets the number of minutes in d.

toSeconds :: Duration -> Double Source #

toSeconds d gets the number of seconds in d.

Read

durationP :: ReadP Duration Source #

Parses and returns an Duration formatted (-)nHnMn.nS.

readDuration :: String -> Maybe Duration Source #

Reads an a Duration from the given string using durationP.