thyme-0.3.5.5: A faster time library

Safe Haskell | None
Language | Haskell2010

Data.Thyme.Calendar.OrdinalDate

Contents

- Orphan instances

Description

ISO 8601 Ordinal Date format

Synopsis

- type Year = Int
- isLeapYear :: Year -> Bool
- type DayOfYear = Int
- data OrdinalDate = OrdinalDate {
  - odYear :: !Year
  - odDay :: !DayOfYear
  }
- ordinalDate :: Iso' Day OrdinalDate
- ordinalDateValid :: OrdinalDate -> Maybe Day
- _odYear :: Lens' OrdinalDate Year
- _odDay :: Lens' OrdinalDate DayOfYear

# Documentation

type Year = Int Source #

isLeapYear :: Year -> Bool Source #

Gregorian leap year?

type DayOfYear = Int Source #

data OrdinalDate Source #

Constructors

OrdinalDate |

Fields

- odYear :: !Year
- odDay :: !DayOfYear

#### Instances

Instances details

Bounded OrdinalDate |
Instance details Defined in Data.Thyme.Calendar.OrdinalDate Methods minBound :: OrdinalDate maxBound :: OrdinalDate
Eq OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal Methods (==) :: OrdinalDate -> OrdinalDate -> Bool (/=) :: OrdinalDate -> OrdinalDate -> Bool
Data OrdinalDate Source # |

Instance details

Defined in Data.Thyme.Calendar.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OrdinalDate -> c OrdinalDate

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OrdinalDate

toConstr :: OrdinalDate -> Constr

dataTypeOf :: OrdinalDate -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OrdinalDate)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrdinalDate)

gmapT :: (forall b. Data b => b -> b) -> OrdinalDate -> OrdinalDate

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OrdinalDate -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OrdinalDate -> r

gmapQ :: (forall d. Data d => d -> u) -> OrdinalDate -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> OrdinalDate -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OrdinalDate -> m OrdinalDate

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OrdinalDate -> m OrdinalDate

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OrdinalDate -> m OrdinalDate

Ord OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal Methods compare :: OrdinalDate -> OrdinalDate -> Ordering (<) :: OrdinalDate -> OrdinalDate -> Bool (<=) :: OrdinalDate -> OrdinalDate -> Bool (>) :: OrdinalDate -> OrdinalDate -> Bool (>=) :: OrdinalDate -> OrdinalDate -> Bool max :: OrdinalDate -> OrdinalDate -> OrdinalDate min :: OrdinalDate -> OrdinalDate -> OrdinalDate
Show OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal Methods showsPrec :: Int -> OrdinalDate -> ShowS show :: OrdinalDate -> String showList :: [OrdinalDate] -> ShowS
Generic OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal Associated Types type Rep OrdinalDate :: Type -> Type Methods from :: OrdinalDate -> Rep OrdinalDate x to :: Rep OrdinalDate x -> OrdinalDate
Arbitrary OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.OrdinalDate Methods arbitrary :: Gen OrdinalDate Source # shrink :: OrdinalDate -> [OrdinalDate] Source #
CoArbitrary OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.OrdinalDate Methods coarbitrary :: OrdinalDate -> Gen b -> Gen b Source #
Random OrdinalDate Source # |

Instance details

Defined in Data.Thyme.Calendar.OrdinalDate

Methods

randomR :: RandomGen g => (OrdinalDate, OrdinalDate) -> g -> (OrdinalDate, g) Source #

random :: RandomGen g => g -> (OrdinalDate, g) Source #

randomRs :: RandomGen g => (OrdinalDate, OrdinalDate) -> g -> [OrdinalDate] Source #

randoms :: RandomGen g => g -> [OrdinalDate] Source #

randomRIO :: (OrdinalDate, OrdinalDate) -> IO OrdinalDate Source #

randomIO :: IO OrdinalDate Source #

Unbox OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal
NFData OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal Methods rnf :: OrdinalDate -> ()
ParseTime OrdinalDate Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> OrdinalDate Source #
FormatTime OrdinalDate Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> OrdinalDate -> (Char -> ShowS) -> Char -> ShowS Source #
Vector Vector OrdinalDate Source # |

Instance details

Defined in Data.Thyme.Calendar.Internal

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) OrdinalDate -> m (Vector OrdinalDate) Source #

basicUnsafeThaw :: PrimMonad m => Vector OrdinalDate -> m (Mutable Vector (PrimState m) OrdinalDate) Source #

basicLength :: Vector OrdinalDate -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector OrdinalDate -> Vector OrdinalDate Source #

basicUnsafeIndexM :: Monad m => Vector OrdinalDate -> Int -> m OrdinalDate Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) OrdinalDate -> Vector OrdinalDate -> m () Source #

elemseq :: Vector OrdinalDate -> OrdinalDate -> b -> b Source #

MVector MVector OrdinalDate Source # |

Instance details

Defined in Data.Thyme.Calendar.Internal

Methods

basicLength :: MVector s OrdinalDate -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s OrdinalDate -> MVector s OrdinalDate Source #

basicOverlaps :: MVector s OrdinalDate -> MVector s OrdinalDate -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) OrdinalDate) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) OrdinalDate -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> OrdinalDate -> m (MVector (PrimState m) OrdinalDate) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) OrdinalDate -> Int -> m OrdinalDate Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) OrdinalDate -> Int -> OrdinalDate -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) OrdinalDate -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) OrdinalDate -> OrdinalDate -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) OrdinalDate -> MVector (PrimState m) OrdinalDate -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) OrdinalDate -> MVector (PrimState m) OrdinalDate -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) OrdinalDate -> Int -> m (MVector (PrimState m) OrdinalDate) Source #

type Rep OrdinalDate Source # |

Instance details

Defined in Data.Thyme.Calendar.Internal

type Rep OrdinalDate = D1 ('MetaData "OrdinalDate" "Data.Thyme.Calendar.Internal" "thyme-0.3.5.5-8yk8awDjzEHHYSq2xJCwO3" 'False) (C1 ('MetaCons "OrdinalDate" 'PrefixI 'True) (S1 ('MetaSel ('Just "odYear") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Year) :*: S1 ('MetaSel ('Just "odDay") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 DayOfYear)))

newtype Vector OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal newtype Vector OrdinalDate = V_OrdinalDate (Vector Int)
newtype MVector s OrdinalDate Source # |
Instance details Defined in Data.Thyme.Calendar.Internal newtype MVector s OrdinalDate = MV_OrdinalDate (MVector s Int)

ordinalDate :: Iso' Day OrdinalDate Source #

ordinalDateValid :: OrdinalDate -> Maybe Day Source #

_odYear :: Lens' OrdinalDate Year Source #

_odDay :: Lens' OrdinalDate DayOfYear Source #

# Orphan instances

Bounded OrdinalDate Source # |
Instance details Methods minBound :: OrdinalDate maxBound :: OrdinalDate
Arbitrary OrdinalDate Source # |
Instance details Methods arbitrary :: Gen OrdinalDate Source # shrink :: OrdinalDate -> [OrdinalDate] Source #
CoArbitrary OrdinalDate Source # |
Instance details Methods coarbitrary :: OrdinalDate -> Gen b -> Gen b Source #
Random OrdinalDate Source # |

Instance details

Methods

randomR :: RandomGen g => (OrdinalDate, OrdinalDate) -> g -> (OrdinalDate, g) Source #

random :: RandomGen g => g -> (OrdinalDate, g) Source #

randomRs :: RandomGen g => (OrdinalDate, OrdinalDate) -> g -> [OrdinalDate] Source #

randoms :: RandomGen g => g -> [OrdinalDate] Source #

randomRIO :: (OrdinalDate, OrdinalDate) -> IO OrdinalDate Source #

randomIO :: IO OrdinalDate Source #