antikythera-0.1.0.0: Simple job/task/event scheduler/cronjob
CopyrightGautier DI FOLCO
LicenseISC
MaintainerGautier DI FOLCO <gautier.difolco@gmail.com>
StabilityStable
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Antikythera.Unit.Unit

Description

Standalone definition Unit, for Periodicy definition

Synopsis

Documentation

data Unit i a Source #

Type use to define Periodicy patterns (e.g. every, at) for time types

For example:

instance HasMinute TimeOfDay where
  minute =
    Unit
      { extract = todMin
      , nextUnitWith = \n x ->
          let m = n `mod` 60
          in Just $ TimeOfDay ((x.todHour + (if m <= x.todMin then 1 else 0)) `mod` 24) m 0
      }

Constructors

Unit 

Fields