Copyright | (c) 2018 Cedric Liegeois |
---|---|
License | BSD3 |
Maintainer | Cedric Liegeois <ofmooseandmen@yahoo.fr> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Types and functions for working with (signed) durations.
Synopsis
- data Duration
- toMilliseconds :: Duration -> Int
- milliseconds :: Double -> Duration
- hours :: Double -> Duration
- minutes :: Double -> Duration
- seconds :: Double -> Duration
- hms :: Int -> Int -> Double -> Duration
- toHours :: Duration -> Double
- toMinutes :: Duration -> Double
- toSeconds :: Duration -> Double
- readDuration :: String -> Duration
- readDurationE :: String -> Either String Duration
- readDurationF :: MonadFail m => String -> m Duration
The Duration
type
A durartion with a resolution of 1 millisecond.
Instances
Eq Duration Source # | |
Read Duration Source # | See |
Show Duration Source # | show Duration as |
Quantity Duration Source # | Add/Subtract Durations. |
NTransform a => IsGreatArc (Track a, Duration) Source # |
|
NTransform a => IsGreatArc (Track a, Duration, Length) Source # |
|
toMilliseconds :: Duration -> Int Source #
the number of milliseconds in duration.
Smart constructors
Conversions
Read
readDuration :: String -> Duration Source #
readDurationE :: String -> Either String Duration Source #
Same as readDuration
but returns a Either
.
readDurationF :: MonadFail m => String -> m Duration Source #
Same as readDuration
but returns a MonadFail
.