[Haskell-cafe] ANNOUNCE: time-lens-0.1
Roman Cheplyaka
roma at ro-che.info
Sat May 19 17:01:36 CEST 2012
I'm happy to announce the first, experimental version of the
time-lens library.
http://hackage.haskell.org/package/time-lens
https://github.com/feuerbach/time-lens
Its goal is to simplify working with time and date data structures in
Haskell by providing lens-based overloaded accessors for Data.Time
types.
E.g. to find the current hour you currently need to write something like
todHour . localTimeOfDay . zonedTimeToLocalTime <$> getZonedTime
With time-lens it becomes
getL hours <$> getZonedTime
The difference is even more impressive when you need to *update* the hour
in a ZonedTime structure, but admittedly such a need is relatively rare.
The library is pure Haskell 2010 code. It is also completely
type-compatible with Data.Time, so it's very easy to start using it in
existing projects.
--
Roman I. Cheplyaka :: http://ro-che.info/
More information about the Haskell-Cafe
mailing list