Safe Haskell | Safe-Infered |
---|
Formatting time is slow. This package provides mechanisms to cache formatted date.
- data DateCacheConf t = DateCacheConf {
- getTime :: IO t
- formatDate :: t -> IO ByteString
- type DateCacheGetter = IO ByteString
- type DateCacheCloser = IO ()
- ondemandDateCacher :: Eq t => DateCacheConf t -> IO (DateCacheGetter, DateCacheCloser)
- clockDateCacher :: Eq t => DateCacheConf t -> IO (DateCacheGetter, DateCacheCloser)
Types
data DateCacheConf t Source
DateCacheConf | |
|
type DateCacheGetter = IO ByteStringSource
type DateCacheCloser = IO ()Source
Date cacher
ondemandDateCacher :: Eq t => DateCacheConf t -> IO (DateCacheGetter, DateCacheCloser)Source
Date cacher which gets a time and formatted it only when returned getter is executed.
clockDateCacher :: Eq t => DateCacheConf t -> IO (DateCacheGetter, DateCacheCloser)Source
Date cacher which gets a time and formatted it every second. This returns a getter.