@hackage chronos1.1.6.0
A high-performance time library
Categories
License
BSD-3-Clause
Maintainer
Andrew Martin <andrew.thaddeus@gmail.com> chessai <chessai1996@gmail.com>
Links
Versions
Installation
Tested Compilers
Dependencies (17)
Dependents (29)
@hackage/relevant-time, @hackage/sqel, @hackage/ribosome-host, @hackage/proteome, @hackage/syslog, @hackage/polysemy-account, Show all…
Chronos is a performance-oriented time library for Haskell, with a straightforward API. The main differences between this and the time library are:
Chronos uses machine integers where possible. This means that time-related arithmetic should be faster, with the drawback that the types are incapable of representing times that are very far in the future or the past (because Chronos provides nanosecond, rather than picosecond, resolution). For most users, this is not a hindrance.
Chronos provides
ToJSON/FromJSONinstances for serialisation.Chronos provides
Unboxinstances for working with unboxed vectors.Chronos provides
Priminstances for working with byte arrays/primitive arrays.Chronos uses normal non-overloaded haskell functions for encoding and decoding time. It provides attoparsec parsers for both
TextandByteString. Additionally, Chronos provides functions for encoding time toTextorByteString. The http://hackage.haskell.org/package/time time> library accomplishes these with the Data.Time.Format module, which uses UNIX-style datetime format strings. The approach taken by Chronos is faster and catches more mistakes at compile time, at the cost of being less expressive.