stateTQ :: (TimeoutQueue -> (a, TimeoutQueue)) -> Mgr a
stateTQ f = Mgr $ \s -> do
    let (a, !s') = f s
    return (a, s')

------------------------------------------------------------------------
-- I/O manager loop

-- | Call all expired timeouts, and return how much time until the next expiration.
stateTQ :: (TimeoutQueue -> (a, TimeoutQueue)) -> Mgr a
stateTQ f = Mgr $ \s -> do
    let (a, !s') = f s
    return (a, s')

------------------------------------------------------------------------
-- I/O manager loop

-- | Call all expired timeouts, and return how much time until the next expiration.
stateTQ f = Mgr $ \s -> do
    let (a, !s') = f s
    return (a, s')

------------------------------------------------------------------------
-- I/O manager loop

-- | Call all expired timeouts, and return how much time until the next expiration.