mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Rename constructorLabelWithSource => constructorNameAndConstantFields
This commit is contained in:
parent
31a2e6a08d
commit
28a3313d12
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user