-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A faster time library -- -- A faster time library @package thyme @version 0.1.0.0 -- | ISO 8601 Ordinal Date format module Data.Thyme.Calendar.OrdinalDate type Year = Int type DayOfYear = Int data OrdinalDate OrdinalDate :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !DayOfYear -> OrdinalDate odYear :: OrdinalDate -> {-# UNPACK #-} !Year odDay :: OrdinalDate -> {-# UNPACK #-} !DayOfYear ordinalDate :: Simple Iso Day OrdinalDate fromOrdinalDateValid :: OrdinalDate -> Maybe Day isLeapYear :: Year -> Bool _odYear :: Lens OrdinalDate OrdinalDate Year Year _odDay :: Lens OrdinalDate OrdinalDate DayOfYear DayOfYear module Data.Thyme.Calendar.MonthDay type Month = Int type DayOfMonth = Int data MonthDay MonthDay :: {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> MonthDay mdMonth :: MonthDay -> {-# UNPACK #-} !Month mdDay :: MonthDay -> {-# UNPACK #-} !DayOfMonth -- | Convert between day of year in the Gregorian or Julian calendars, and -- month and day of month. First arg is leap year flag. monthDay :: Bool -> Simple Iso DayOfYear MonthDay monthDayToDayOfYearValid :: Bool -> MonthDay -> Maybe DayOfYear monthLength :: Bool -> Month -> Int _mdMonth :: Lens MonthDay MonthDay Month Month _mdDay :: Lens MonthDay MonthDay DayOfMonth DayOfMonth instance Typeable MonthDay instance Eq MonthDay instance Ord MonthDay instance Data MonthDay instance Show MonthDay instance NFData MonthDay -- | ISO 8601 Week Date format module Data.Thyme.Calendar.WeekDate type Week = Int type DayOfWeek = Int data WeekDate WeekDate :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !Week -> {-# UNPACK #-} !DayOfWeek -> WeekDate wdYear :: WeekDate -> {-# UNPACK #-} !Year wdWeek :: WeekDate -> {-# UNPACK #-} !Week wdDay :: WeekDate -> {-# UNPACK #-} !DayOfWeek weekDate :: Simple Iso Day WeekDate fromWeekDateValid :: WeekDate -> Maybe Day showWeekDate :: Day -> String _wdYear :: Lens WeekDate WeekDate Year Year _wdWeek :: Lens WeekDate WeekDate Week Week _wdDay :: Lens WeekDate WeekDate DayOfWeek DayOfWeek instance Typeable WeekDate instance Eq WeekDate instance Ord WeekDate instance Data WeekDate instance Show WeekDate module Data.Thyme.Clock.POSIX posixDayLength :: NominalDiffTime type POSIXTime = NominalDiffTime posixTime :: Simple Iso UTCTime POSIXTime getPOSIXTime :: IO POSIXTime module Data.Thyme.Clock data DiffTime microsecondsToDiffTime :: Int64 -> DiffTime data UTCTime data UTCView UTCTime :: {-# UNPACK #-} !Day -> {-# UNPACK #-} !DiffTime -> UTCView utctDay :: UTCView -> {-# UNPACK #-} !Day utctDayTime :: UTCView -> {-# UNPACK #-} !DiffTime utcTime :: Simple Iso UTCTime UTCView data NominalDiffTime getCurrentTime :: IO UTCTime _utctDay :: Simple Lens UTCTime Day _utctDayTime :: Simple Lens UTCTime DiffTime module Data.Thyme.LocalTime -- | A TimeZone is a whole number of minutes offset from UTC, together with -- a name and a "just for summer" flag. data TimeZone :: * TimeZone :: Int -> Bool -> String -> TimeZone -- | The number of minutes offset from UTC. Positive means local time will -- be later in the day than UTC. timeZoneMinutes :: TimeZone -> Int -- | Is this time zone just persisting for the summer? timeZoneSummerOnly :: TimeZone -> Bool -- | The name of the zone, typically a three- or four-letter acronym. timeZoneName :: TimeZone -> String -- | Text representing the offset of this timezone, such as "-0800" or -- "+0400" (like %z in formatTime) timeZoneOffsetString :: TimeZone -> String -- | Text representing the offset of this timezone, such as "-0800" or -- "+0400" (like %z in formatTime), with arbitrary padding timeZoneOffsetString' :: NumericPadOption -> TimeZone -> String -- | Create a nameless non-summer timezone for this number of minutes minutesToTimeZone :: Int -> TimeZone -- | Create a nameless non-summer timezone for this number of hours hoursToTimeZone :: Int -> TimeZone -- | The UTC time zone utc :: TimeZone -- | Get the current time-zone getCurrentTimeZone :: IO TimeZone getTimeZone :: UTCTime -> IO TimeZone type Hour = Int type Minute = Int data TimeOfDay TimeOfDay :: {-# UNPACK #-} !Hour -> {-# UNPACK #-} !Minute -> {-# UNPACK #-} !DiffTime -> TimeOfDay todHour :: TimeOfDay -> {-# UNPACK #-} !Hour todMin :: TimeOfDay -> {-# UNPACK #-} !Minute todSec :: TimeOfDay -> {-# UNPACK #-} !DiffTime makeTimeOfDayValid :: Hour -> Minute -> DiffTime -> Maybe TimeOfDay timeOfDay :: Simple Iso DiffTime TimeOfDay type Minutes = Int type Days = Int -- | Add some minutes to a TimeOfDay; result comes with a day -- adjustment. addMinutes :: Minutes -> TimeOfDay -> (Days, TimeOfDay) timeOfDayFraction :: Simple Iso Rational TimeOfDay data LocalTime LocalTime :: {-# UNPACK #-} !Day -> {-# UNPACK #-} !TimeOfDay -> LocalTime localDay :: LocalTime -> {-# UNPACK #-} !Day localTimeOfDay :: LocalTime -> {-# UNPACK #-} !TimeOfDay utcLocalTime :: TimeZone -> Simple Iso UTCTime LocalTime data ZonedTime ZonedTime :: {-# UNPACK #-} !LocalTime -> !TimeZone -> ZonedTime zonedTimeToLocalTime :: ZonedTime -> {-# UNPACK #-} !LocalTime zonedTimeZone :: ZonedTime -> !TimeZone zonedTime :: Simple Iso (TimeZone, UTCTime) ZonedTime getZonedTime :: IO ZonedTime utcToLocalZonedTime :: UTCTime -> IO ZonedTime _timeZoneSummerOnly :: Lens TimeZone TimeZone Bool Bool _timeZoneName :: Lens TimeZone TimeZone String String _timeZoneMinutes :: Lens TimeZone TimeZone Int Int _todSec :: Lens TimeOfDay TimeOfDay DiffTime DiffTime _todMin :: Lens TimeOfDay TimeOfDay Minute Minute _todHour :: Lens TimeOfDay TimeOfDay Hour Hour _localTimeOfDay :: Lens LocalTime LocalTime TimeOfDay TimeOfDay _localDay :: Lens LocalTime LocalTime Day Day _zonedTimeZone :: Lens ZonedTime ZonedTime TimeZone TimeZone _zonedTimeToLocalTime :: Lens ZonedTime ZonedTime LocalTime LocalTime instance Typeable TimeOfDay instance Typeable LocalTime instance Typeable ZonedTime instance Eq TimeOfDay instance Ord TimeOfDay instance Data TimeOfDay instance Show TimeOfDay instance Eq LocalTime instance Ord LocalTime instance Data LocalTime instance Show LocalTime instance Eq ZonedTime instance Ord ZonedTime instance Data ZonedTime instance Show ZonedTime module Data.Thyme.Calendar -- | The Modified Julian Day is a standard count of days, with zero being -- the day 1858-11-17. newtype Day ModifiedJulianDay :: Int64 -> Day toModifiedJulianDay :: Day -> Int64 type Year = Int type Month = Int type DayOfMonth = Int data YearMonthDay YearMonthDay :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> YearMonthDay ymdYear :: YearMonthDay -> {-# UNPACK #-} !Year ymdMonth :: YearMonthDay -> {-# UNPACK #-} !Month ymdDay :: YearMonthDay -> {-# UNPACK #-} !DayOfMonth gregorian :: Simple Iso Day YearMonthDay fromGregorianValid :: YearMonthDay -> Maybe Day gregorianMonthLength :: Year -> Month -> Int isLeapYear :: Year -> Bool _toModifiedJulianDay :: Iso Day Day Int64 Int64 _ymdYear :: Lens YearMonthDay YearMonthDay Year Year _ymdMonth :: Lens YearMonthDay YearMonthDay Month Month _ymdDay :: Lens YearMonthDay YearMonthDay DayOfMonth DayOfMonth module Data.Thyme