jord-2.0.0.0: Geographical Position Calculations
Copyright(c) 2020 Cedric Liegeois
LicenseBSD3
MaintainerCedric Liegeois <ofmooseandmen@yahoo.fr>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Geo.Jord.Duration

Description

Types and functions for working with (signed) durations.

In order to use this module you should start with the following imports:

import Data.Geo.Jord.Duration (Duration)
import qualified Data.Geo.Jord.Duration as Duration
Synopsis

The Duration type

data Duration Source #

A duration with a resolution of 1 millisecond.

Instances

Instances details
Eq Duration Source # 
Instance details

Defined in Data.Geo.Jord.Duration

Ord Duration Source # 
Instance details

Defined in Data.Geo.Jord.Duration

Read Duration Source #

See duration.

Instance details

Defined in Data.Geo.Jord.Duration

Show Duration Source #

Show Duration as (-)nHnMn.nS.

Instance details

Defined in Data.Geo.Jord.Duration

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

duration :: ReadP Duration Source #

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

read :: String -> Maybe Duration Source #

Reads a Duration from the given string using duration.

Misc

add :: Duration -> Duration -> Duration Source #

Adds 2 durations.

subtract :: Duration -> Duration -> Duration Source #

Subtracts 2 durations.

zero :: Duration Source #

0 duration.