2015-08-13 14:47:36 +00:00
|
|
|
name: human-readable-duration
|
2016-01-12 14:27:44 +00:00
|
|
|
version: 0.2.0.0
|
2015-08-13 14:47:36 +00:00
|
|
|
synopsis: Provide duration helper
|
|
|
|
homepage: http://github.com/yogsototh/human-readable-duration#readme
|
|
|
|
license: BSD3
|
|
|
|
license-file: LICENSE
|
|
|
|
author: Yann Esposito
|
|
|
|
maintainer: yann.esposito@gmail.com
|
|
|
|
category: Time
|
|
|
|
build-type: Simple
|
|
|
|
-- extra-source-files:
|
|
|
|
cabal-version: >=1.10
|
2015-08-13 15:14:26 +00:00
|
|
|
description:
|
|
|
|
This is a minimal Haskell library to display duration.
|
|
|
|
.
|
|
|
|
> let duration = 2 * ms + 3 * oneSecond + 2 * minute + 33*day + 2*year
|
|
|
|
> humanReadableDuration duration
|
2015-11-25 19:55:57 +00:00
|
|
|
> -- will return: "2 years 33 days 2 min 3s 2ms"
|
2015-08-13 15:14:26 +00:00
|
|
|
> getYears duration
|
|
|
|
> -- will return 2
|
|
|
|
> getDays duration
|
2015-11-25 19:55:57 +00:00
|
|
|
> -- will return 763
|
2015-08-13 15:14:26 +00:00
|
|
|
> getMs duration
|
2015-11-25 19:55:57 +00:00
|
|
|
> -- will return 65923323002
|
2015-08-13 14:47:36 +00:00
|
|
|
|
|
|
|
library
|
|
|
|
hs-source-dirs: src
|
|
|
|
exposed-modules: Data.Duration
|
|
|
|
build-depends: base >= 4.7 && < 5
|
|
|
|
default-language: Haskell2010
|
|
|
|
|
|
|
|
-- test-suite human-readable-duration-test
|
|
|
|
-- type: exitcode-stdio-1.0
|
|
|
|
-- hs-source-dirs: test
|
|
|
|
-- main-is: Spec.hs
|
|
|
|
-- build-depends: base
|
|
|
|
-- , human-readable-duration
|
|
|
|
-- ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
|
|
|
-- default-language: Haskell2010
|
|
|
|
|
|
|
|
source-repository head
|
|
|
|
type: git
|
|
|
|
location: https://github.com/yogstoth/human-readable-duration
|