1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Evaluate diffs in parallel.

This commit is contained in:
Rob Rix 2017-04-04 10:57:18 -04:00
parent 35cdc611ad
commit b4d72cc62c
2 changed files with 4 additions and 2 deletions

View File

@ -89,6 +89,7 @@ library
, MonadRandom
, mtl
, optparse-applicative
, parallel
, pointed
, protolude
, recursion-schemes

View File

@ -16,6 +16,7 @@ module Command
import Command.Parse
import Control.Exception (catch)
import Control.Monad.Free.Freer
import Control.Parallel.Strategies
import qualified Data.ByteString as B
import Data.Functor.Both
import Data.List ((\\))
@ -83,8 +84,8 @@ maybeDiff terms = case runJoin terms of
(Nothing, Nothing) -> return Nothing
-- | Render a diff using the specified renderer.
renderDiffs :: Monoid output => DiffRenderer fields output -> [(Both SourceBlob, Diff (Syntax Text) (Record fields))] -> Command output
renderDiffs renderer diffs = RenderDiffs renderer diffs `Then` return
renderDiffs :: (NFData (Record fields), Monoid output) => DiffRenderer fields output -> [(Both SourceBlob, Diff (Syntax Text) (Record fields))] -> Command output
renderDiffs renderer diffs = RenderDiffs renderer (diffs `using` parTraversable (parTuple2 r0 rdeepseq)) `Then` return
-- Evaluation