definition:
|
addMonths :: Int -> ClockTime -> ClockTime
addMonths n ctime =
let CalendarTime y mo d h mi s tz = toUTCTime ctime
nmo = (mo-1+n) `mod` 12 + 1
in
if nmo>0
then addYears ((mo-1+n) `div` 12)
(toClockTime (CalendarTime y nmo d h mi s tz))
else addYears ((mo-1+n) `div` 12 - 1)
(toClockTime (CalendarTime y (nmo+12) d h mi s tz))
|
demand:
|
no demanded arguments
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Adds months to a given time.
|
failfree:
|
(_, _)
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_) |-> _}
|
name:
|
addMonths
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Prelude.Int -> ClockTime -> ClockTime
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|