From 7e5f448027b59231e566ee442dee87a4b2a9c954 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 3 Apr 2018 18:17:36 -0400 Subject: [PATCH] Add type synonyms for the logging & statting queues. --- src/Semantic/Task.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Semantic/Task.hs b/src/Semantic/Task.hs index 9759b74e2..c9334677f 100644 --- a/src/Semantic/Task.hs +++ b/src/Semantic/Task.hs @@ -72,6 +72,9 @@ data TaskF output where Distribute :: Traversable t => t (Task output) -> TaskF (t output) Bidistribute :: Bitraversable t => t (Task output1) (Task output2) -> TaskF (t output1 output2) +type Logger = AsyncQueue Message Options +type Statter = AsyncQueue Stat StatsClient + -- | A high-level task producing some result, e.g. parsing, diffing, rendering. 'Task's can also specify explicit concurrency via 'distribute', 'distributeFor', and 'distributeFoldMap' type Task = Eff '[TaskF, Exc SomeException, IO] @@ -174,8 +177,8 @@ runTaskWithOptions options task = do either (die . displayException) pure result where run :: Options - -> AsyncQueue Message Options - -> AsyncQueue Stat StatsClient + -> Logger + -> Statter -> Task a -> IO (Either SomeException a) run options logger statter = run'