diff --git a/src/Decorators.hs b/src/Decorators.hs index 85983655b..fa25ce1e6 100644 --- a/src/Decorators.hs +++ b/src/Decorators.hs @@ -1,7 +1,7 @@ {-# LANGUAGE DataKinds, TypeOperators #-} module Decorators ( ConstructorLabel(..) -, constructorLabelWithSource +, constructorNameAndConstantFields , constructorLabel ) where @@ -20,8 +20,8 @@ import Text.Show -- -- This uses 'liftShowsPrec' to produce the 'ByteString', with the effect that -- constant fields will be included and parametric fields will not be. -constructorLabelWithSource :: Show1 f => TermF f a b -> ByteString -constructorLabelWithSource (_ :< f) = toS (liftShowsPrec (const (const identity)) (const identity) 0 f "") +constructorNameAndConstantFields :: Show1 f => TermF f a b -> ByteString +constructorNameAndConstantFields (_ :< f) = toS (liftShowsPrec (const (const identity)) (const identity) 0 f "") -- | Compute a 'ConstructorLabel' label for a 'Union' of syntax 'Term's. constructorLabel :: ConstructorName f => TermF f a b -> ConstructorLabel diff --git a/src/Semantic.hs b/src/Semantic.hs index 1cfe4f302..95b6cb8f7 100644 --- a/src/Semantic.hs +++ b/src/Semantic.hs @@ -85,7 +85,7 @@ diffBlobPair renderer blobs = case (renderer, effectiveLanguage) of run parse diff renderer = distributeFor blobs (parse . blobSource) >>= diffTermPair blobs diff >>= render renderer diffLinearly :: (Eq1 f, GAlign f, Show1 f, Traversable f) => Both (Term f (Record fields)) -> Diff f (Record fields) - diffLinearly = decoratingWith constructorLabelWithSource (diffTermsWith linearly comparableByConstructor) + diffLinearly = decoratingWith constructorNameAndConstantFields (diffTermsWith linearly comparableByConstructor) -- | A task to diff a pair of 'Term's, producing insertion/deletion 'Patch'es for non-existent 'Blob's. diffTermPair :: Functor f => Both Blob -> Differ f a -> Both (Term f a) -> Task (Diff f a)