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

Correct how the graph title is constructed.

This commit is contained in:
Rob Rix 2017-12-18 11:07:40 -05:00
parent 3aa6333405
commit ff43062310

View File

@ -19,7 +19,8 @@ import Data.Term
import Data.These (These, mergeThese) import Data.These (These, mergeThese)
renderDOTDiff :: (ConstructorName syntax, Foldable syntax, Functor syntax) => Join These Blob -> Diff syntax ann1 ann2 -> B.ByteString 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 (mergeThese ((<>) . (" -> " <>)) (runJoin (fmap (B.pack . blobPath) blobs))) } renderDOTDiff blobs diff = renderGraph (snd (cata diffAlgebra diff 0)) { graphName = Just (B.pack (mergeThese combine (runJoin (blobPath <$> blobs)))) }
where combine p1 p2 = p1 <> " -> " <> p2
renderDOTTerm :: (ConstructorName syntax, Foldable syntax, Functor syntax) => Blob -> Term syntax ann -> B.ByteString 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) } renderDOTTerm Blob{..} term = renderGraph (snd (cata termAlgebra term 0)) { graphName = Just (B.pack blobPath) }