MIT licensed by Michael B. Gale
Maintained by [email protected]
This version can be pinned in stack with:time-units-types-0.2.0.1@sha256:7ef11236dd3b6433ec9df3341e98bc70c35dbe2341d1a8fc6a0b4255349ce162,1180

Module documentation for 0.2.0.1

Depends on 2 packages(full list with versions):
Used by 1 package in lts-21.7(full list with versions):

time-units-types

MIT Build Hackage

This Haskell library exports types which can be used to describe simple type periods at the type-level. The type-level descriptions can then be reifed to corresponding values of the time-units library.

{-# LANGUAGE TypeApplications #-}

import Data.Time.TypeLevel

type TenSeconds = 'Second 10

main :: IO ()
main = do
    -- `durationVal` converts the type-level specification to a corresponding
    -- value from "Data.Time.Units"
    print $ durationVal @TenSeconds
    -- `durationMicroseconds` converts the type-level specification to a
    -- corresponding integer value, representing microseconds
    print $ durationMicroseconds @TenSeconds

See the Haddock documentation for a reference of all supported units.

See also

Related/similar projects:

Changes

Changelog for time-units-types

0.1

  • First release