previewPoll :: HakyllConfiguration  -- ^ Configuration
            -> IO [FilePath]        -- ^ Updating action
            -> IO ()                -- ^ Can block forever
previewPoll _ update = do
    time <- getClockTime
    loop time =<< update
  where
    delay = 1000000
    loop time files = do
        threadDelay delay
        files' <- filterM doesFileExist files
        filesTime <- case files' of
            []  -> return time
            _   -> maximum <$> mapM getModificationTime files'

        if filesTime > time || files' /= files
            then loop filesTime =<< update
            else loop time files'
previewPoll :: HakyllConfiguration  -- ^ Configuration
            -> IO [FilePath]        -- ^ Updating action
            -> IO ()
previewPoll _ update = do
    time <- getClockTime
    loop time =<< update
  where
    delay = 1000000
    loop time files = do
        threadDelay delay
        files' <- filterM doesFileExist files
        filesTime <- case files' of
            []  -> return time
            _   -> maximum <$> mapM getModificationTime files'

        if filesTime > time || files' /= files
            then loop filesTime =<< update
            else loop time files'
previewPoll _ update = do
    time <- getClockTime
    loop time =<< update
  where
    delay = 1000000
    loop time files = do
        threadDelay delay
        files' <- filterM doesFileExist files
        filesTime <- case files' of
            []  -> return time
            _   -> maximum <$> mapM getModificationTime files'

        if filesTime > time || files' /= files
            then loop filesTime =<< update
            else loop time files'