human-readable-duration: Provide duration helper

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

This is a minimal Haskell library to display duration.

let duration = 2 * ms + 3 * oneSecond + 2 * minute + 33*day + 2*year
humanReadableDuration duration
-- will return: "2 years 33 days 2 min 3s 2ms"
getYears duration
-- will return 2
getDays duration
-- will return 763
getMs duration
-- will return 65923323002

[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.1.0, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.2.1.4, 0.2.1.4
Change logNone available
Dependenciesbase (>=4.7 && <5) [details]
LicenseBSD-3-Clause
AuthorYann Esposito
Maintaineryann.esposito@gmail.com
CategoryTime
Home pagehttps://gitlab.esy.fun/yogsototh/human-readable-duration#readme
Source repositoryhead: git clone https://gitlab.esy.fun/yogsototh/human-readable-duration
UploadedTue Jun 25 15:57:36 UTC 2019 by yogsototh

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for human-readable-duration-0.2.1.4

[back to package description]

Build Status

Hackage human-readable-duration human-readable-duration

Issue Count

Human Readable Duration

This is a minimal Haskell library to display duration. It is mostly unsafe as it uses only Int and Strings (not even Text nor ByteString).

Usage

> import Data.Duration
> let duration = 2*ms + 3*oneSecond + 2*minute + 33*day + 2*year
> humanReadableDuration duration
"2 years 33 days 2 min 3s 2ms"
> getYears duration
2
> getDays duration
763
> getMs duration
65923323002

Install

Install stack.

stack build