1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Use pathKeyForBlobPair.

This commit is contained in:
Rob Rix 2018-02-07 11:51:01 -05:00
parent 610c9cd211
commit 80b504ec66

View File

@ -16,11 +16,10 @@ import qualified Data.Map as Map
import Data.Patch
import Data.Semigroup
import Data.Term
import Data.These (These, mergeThese)
import Data.These (These)
renderDOTDiff :: (ConstructorName syntax, Foldable syntax, Functor syntax) => Join These Blob -> Diff syntax ann1 ann2 -> B.ByteString
renderDOTDiff blobs diff = renderGraph (snd (cata diffAlgebra diff 0)) { graphName = Just (B.pack (mergeThese combine (runJoin (blobPath <$> blobs)))) }
where combine p1 p2 = p1 <> " -> " <> p2
renderDOTDiff blobs diff = renderGraph (snd (cata diffAlgebra diff 0)) { graphName = Just (B.pack (pathKeyForBlobPair blobs)) }
renderDOTTerm :: (ConstructorName syntax, Foldable syntax, Functor syntax) => Blob -> Term syntax ann -> B.ByteString
renderDOTTerm Blob{..} term = renderGraph (snd (cata termAlgebra term 0)) { graphName = Just (B.pack blobPath) }