1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Rename runTaskOptions to runTaskWithOptions.

This commit is contained in:
Rob Rix 2017-07-21 15:40:02 -04:00
parent 7577eec628
commit e1c7fb438b
2 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ module Semantic.Task
, defaultOptions , defaultOptions
, configureOptionsForHandle , configureOptionsForHandle
, runTask , runTask
, runTaskOptions , runTaskWithOptions
) where ) where
import Control.Concurrent.STM.TMQueue import Control.Concurrent.STM.TMQueue
@ -152,13 +152,13 @@ configureOptionsForHandle handle options = do
-- | Execute a 'Task' with the 'defaultOptions', yielding its result value in 'IO'. -- | Execute a 'Task' with the 'defaultOptions', yielding its result value in 'IO'.
-- --
-- > runTask = runTaskOptions defaultOptions -- > runTask = runTaskWithOptions defaultOptions
runTask :: Task a -> IO a runTask :: Task a -> IO a
runTask = runTaskOptions defaultOptions runTask = runTaskWithOptions defaultOptions
-- | Execute a 'Task' with the passed 'Options', yielding its result value in 'IO'. -- | Execute a 'Task' with the passed 'Options', yielding its result value in 'IO'.
runTaskOptions :: Options -> Task a -> IO a runTaskWithOptions :: Options -> Task a -> IO a
runTaskOptions options task = do runTaskWithOptions options task = do
options <- configureOptionsForHandle stderr options options <- configureOptionsForHandle stderr options
logQueue <- newTMQueueIO logQueue <- newTMQueueIO
logging <- async (sink logQueue) logging <- async (sink logQueue)

View File

@ -21,7 +21,7 @@ import System.IO (stdin)
import qualified Semantic (parseBlobs, diffBlobPairs) import qualified Semantic (parseBlobs, diffBlobPairs)
main :: IO () main :: IO ()
main = customExecParser (prefs showHelpOnEmpty) arguments >>= uncurry Task.runTaskOptions main = customExecParser (prefs showHelpOnEmpty) arguments >>= uncurry Task.runTaskWithOptions
runDiff :: SomeRenderer DiffRenderer -> Either Handle [Both (FilePath, Maybe Language)] -> Task.Task ByteString runDiff :: SomeRenderer DiffRenderer -> Either Handle [Both (FilePath, Maybe Language)] -> Task.Task ByteString
runDiff (SomeRenderer diffRenderer) = Semantic.diffBlobPairs diffRenderer <=< Task.readBlobPairs runDiff (SomeRenderer diffRenderer) = Semantic.diffBlobPairs diffRenderer <=< Task.readBlobPairs