Popularity
3.5
Declining
Activity
0.0
Stable
2
3
1
Monthly Downloads: 5
Programming language: Haskell
License: MIT License
Latest version: v0.0.1.1
tiempo alternatives and similar packages
Based on the "Data" category.
Alternatively, view tiempo alternatives based on common mentions on social networks and blogs.
-
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
semantic-source
Parsing, analyzing, and comparing source code across many languages -
text
Haskell library for space- and time-efficient operations over Unicode text. -
code-builder
Packages for defining APIs, running them, generating client code and documentation. -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
cassava
A CSV parsing and encoding library optimized for ease of use and high performance -
holmes
A reference library for constraint-solving with propagators and CDCL. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
primitive
This package provides various primitive memory-related operations. -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
reflection
Reifies arbitrary Haskell terms into types that can be reflected back into terms -
IORefCAS
A collection of different packages for CAS based data structures. -
dependent-map
Dependently-typed finite maps (partial dependent products) -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text.
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
Do you think we are missing an alternative of tiempo or a related project?
README
tiempo
A sane and simple API that sits on top of the time
library; it
allows the creation of time intervals, and functions to manipulate
time using them. Inspired on the Time
module found on
distributed-process-platform.
Example:
import qualified Control.Concurrent as Concurrent (threadDelay)
import Data.Time (UTCTime, addUTCTime, getCurrentTime)
import Tiempo (TimeInterval, days, hours, minutes,
seconds, toMicroSeconds, toNominalDiffTime,
toSeconds)
threadDelay :: TimeInterval -> IO ()
threadDelay = Concurrent.threadDelay . toMicroSeconds
fromTime :: TimeInterval -> UTCTime -> UTCTime
fromTime interval = addUTCTime (toNominalDiffTime interval)
fromNow :: TimeInterval -> IO UTCTime
fromNow interval = fromTime interval `fmap` getCurrentTime
agoTime :: TimeInterval -> UTCTime -> UTCTime
agoTime interval = addUTCTime (realToFrac (-1 * toSeconds interval))
ago :: TimeInterval -> IO UTCTime
ago interval = agoTime interval `fmap` getCurrentTime
main :: IO ()
main = do
ago (minutes 3) >>= print
getCurrentTime >>= print
fromNow (minutes 3) >>= print
fromNow (hours 4) >>= print
fromNow (days 1) >>= print
threadDelay $ seconds 5
putStrLn "DONE"