posix-timer 0.2.0.1 → 0.3
raw patch · 3 files changed
+13/−13 lines, 3 filesdep ~transformers-basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: transformers-base
API changes (from Hackage documentation)
- System.Posix.Clock: clockSleep :: MonadBase μ IO => Clock -> TimeSpec -> μ TimeSpec
+ System.Posix.Clock: clockSleep :: MonadBase IO μ => Clock -> TimeSpec -> μ TimeSpec
- System.Posix.Clock: clockSleepAbs :: MonadBase μ IO => Clock -> TimeSpec -> μ ()
+ System.Posix.Clock: clockSleepAbs :: MonadBase IO μ => Clock -> TimeSpec -> μ ()
- System.Posix.Clock: getClockResolution :: MonadBase μ IO => Clock -> μ TimeSpec
+ System.Posix.Clock: getClockResolution :: MonadBase IO μ => Clock -> μ TimeSpec
- System.Posix.Clock: getClockTime :: MonadBase μ IO => Clock -> μ TimeSpec
+ System.Posix.Clock: getClockTime :: MonadBase IO μ => Clock -> μ TimeSpec
- System.Posix.Clock: getProcessClock :: MonadBase μ IO => ProcessID -> μ Clock
+ System.Posix.Clock: getProcessClock :: MonadBase IO μ => ProcessID -> μ Clock
- System.Posix.Clock: setClockTime :: MonadBase μ IO => Clock -> TimeSpec -> μ ()
+ System.Posix.Clock: setClockTime :: MonadBase IO μ => Clock -> TimeSpec -> μ ()
- System.Posix.Timer: configureTimer :: MonadBase μ IO => Timer -> Bool -> TimeSpec -> TimeSpec -> μ (TimeSpec, TimeSpec)
+ System.Posix.Timer: configureTimer :: MonadBase IO μ => Timer -> Bool -> TimeSpec -> TimeSpec -> μ (TimeSpec, TimeSpec)
- System.Posix.Timer: createTimer :: MonadBase μ IO => Clock -> Maybe (Signal, WordPtr) -> μ Timer
+ System.Posix.Timer: createTimer :: MonadBase IO μ => Clock -> Maybe (Signal, WordPtr) -> μ Timer
- System.Posix.Timer: destroyTimer :: MonadBase μ IO => Timer -> μ ()
+ System.Posix.Timer: destroyTimer :: MonadBase IO μ => Timer -> μ ()
- System.Posix.Timer: timerOverrunCnt :: MonadBase μ IO => Timer -> μ CInt
+ System.Posix.Timer: timerOverrunCnt :: MonadBase IO μ => Timer -> μ CInt
- System.Posix.Timer: timerTimeLeft :: MonadBase μ IO => Timer -> μ (TimeSpec, TimeSpec)
+ System.Posix.Timer: timerTimeLeft :: MonadBase IO μ => Timer -> μ (TimeSpec, TimeSpec)
Files
- posix-timer.cabal +2/−2
- src/System/Posix/Clock.hsc +6/−6
- src/System/Posix/Timer.hsc +5/−5
posix-timer.cabal view
@@ -1,5 +1,5 @@ Name: posix-timer-Version: 0.2.0.1+Version: 0.3 Category: System Stability: experimental Synopsis: Bindings to POSIX clock and timer functions.@@ -25,7 +25,7 @@ Location: https://github.com/mvv/posix-timer.git Library- Build-Depends: base < 5, unix, transformers-base+ Build-Depends: base < 5, unix, transformers-base >= 0.3 Hs-Source-Dirs: src Include-Dirs: include GHC-Options: -Wall
src/System/Posix/Clock.hsc view
@@ -208,35 +208,35 @@ -- | Get the CPU-time clock of the given process. -- See /clock_getcpuclockid(3)/.-getProcessClock ∷ MonadBase μ IO ⇒ ProcessID → μ Clock+getProcessClock ∷ MonadBase IO μ ⇒ ProcessID → μ Clock getProcessClock pid = liftBase $ alloca $ \p → do throwErrnoIfMinus1_ "getProcClock" $ c_clock_getcpuclockid pid p peek p -- | Get the clock resolution. See /clock_getres(3)/.-getClockResolution ∷ MonadBase μ IO ⇒ Clock → μ TimeSpec+getClockResolution ∷ MonadBase IO μ ⇒ Clock → μ TimeSpec getClockResolution clock = liftBase $ alloca $ \p → do throwErrnoIfMinus1_ "getClockResolution" $ c_clock_getres clock p peek p -- | Get the clock time. See /clock_gettime(3)/.-getClockTime ∷ MonadBase μ IO ⇒ Clock → μ TimeSpec+getClockTime ∷ MonadBase IO μ ⇒ Clock → μ TimeSpec getClockTime clock = liftBase $ alloca $ \p → do throwErrnoIfMinus1_ "getClockTime" $ c_clock_gettime clock p peek p -- | Set the clock time. See /clock_settime(3)/.-setClockTime ∷ MonadBase μ IO ⇒ Clock → TimeSpec → μ ()+setClockTime ∷ MonadBase IO μ ⇒ Clock → TimeSpec → μ () setClockTime clock ts = liftBase $ with ts $ throwErrnoIfMinus1_ "setClockTime" . c_clock_settime clock -- | Sleep for the specified duration. When interrupted by a signal, returns -- the amount of time left to sleep. See /clock_nanosleep(3)/.-clockSleep ∷ MonadBase μ IO ⇒ Clock → TimeSpec → μ TimeSpec+clockSleep ∷ MonadBase IO μ ⇒ Clock → TimeSpec → μ TimeSpec clockSleep clock ts = liftBase $ with ts $ \pTs → alloca $ \pLeft → do @@ -251,7 +251,7 @@ -- | Sleep until the clock time reaches the specified value. -- See /clock_nanosleep(3)/.-clockSleepAbs ∷ MonadBase μ IO ⇒ Clock → TimeSpec → μ ()+clockSleepAbs ∷ MonadBase IO μ ⇒ Clock → TimeSpec → μ () clockSleepAbs clock ts = liftBase $ with ts $ \p → throwErrnoIfMinus1_ "clockSleepAbs" $
src/System/Posix/Timer.hsc view
@@ -55,7 +55,7 @@ newtype Timer = Timer #{itype timer_t} deriving (Eq, Ord, Show, Storable) -- | Create a timer. See /timer_create(3)/.-createTimer ∷ MonadBase μ IO+createTimer ∷ MonadBase IO μ ⇒ Clock → Maybe (Signal, WordPtr) -- ^ Optional signal to raise on timer -- expirations and value of@@ -77,7 +77,7 @@ peek pTimer -- | Setup the timer. See /timer_settime(3)/.-configureTimer ∷ MonadBase μ IO+configureTimer ∷ MonadBase IO μ ⇒ Timer → Bool -- ^ Whether the expiration time is absolute. → TimeSpec -- ^ Expiration time. Zero value disarms the timer.@@ -94,7 +94,7 @@ -- | Get the amount of time left until the next expiration and the interval -- between the subsequent expirations. See /timer_gettime(3)/.-timerTimeLeft ∷ MonadBase μ IO ⇒ Timer → μ (TimeSpec, TimeSpec)+timerTimeLeft ∷ MonadBase IO μ ⇒ Timer → μ (TimeSpec, TimeSpec) timerTimeLeft timer = liftBase $ alloca $ \p → do throwErrnoIfMinus1_ "timerTimeLeft" $ c_timer_gettime timer p@@ -102,12 +102,12 @@ return (value, interval) -- | Get the timer overrun count. See /timer_getoverrun(3)/.-timerOverrunCnt ∷ MonadBase μ IO ⇒ Timer → μ CInt+timerOverrunCnt ∷ MonadBase IO μ ⇒ Timer → μ CInt timerOverrunCnt timer = liftBase $ throwErrnoIfMinus1 "timerOverrunCnt" $ c_timer_getoverrun timer -- | Destroy the timer. See /timer_delete(3)/.-destroyTimer ∷ MonadBase μ IO ⇒ Timer → μ ()+destroyTimer ∷ MonadBase IO μ ⇒ Timer → μ () destroyTimer timer = liftBase $ throwErrnoIfMinus1_ "deleteTimer" $ c_timer_delete timer