From dfe8c842ed3fe574147ba0b707771cbc597fa464 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 21 Sep 2018 09:42:24 -0700 Subject: [PATCH] Term doesn't need to know about Record --- src/Data/Term.hs | 6 ------ test/Diffing/Algorithm/RWS/Spec.hs | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Data/Term.hs b/src/Data/Term.hs index 22faabefb..96daf257d 100644 --- a/src/Data/Term.hs +++ b/src/Data/Term.hs @@ -10,14 +10,12 @@ module Data.Term , termSize , hoistTerm , hoistTermF -, stripTerm , Annotated (..) ) where import Prologue import Data.Aeson import Data.JSON.Fields -import Data.Record import Text.Show import qualified Data.Sum as Sum import Proto3.Suite.Class @@ -71,10 +69,6 @@ hoistTerm f = go where go (Term r) = Term (hoistTermF f (fmap go r)) hoistTermF :: (forall a. f a -> g a) -> TermF f a b -> TermF g a b hoistTermF f = go where go (In a r) = In a (f r) --- | Strips the head annotation off a term annotated with non-empty records. -stripTerm :: Functor f => Term f (Record (h ': t)) -> Term f (Record t) -stripTerm = fmap rtail - type instance Base (Term f a) = TermF f a diff --git a/test/Diffing/Algorithm/RWS/Spec.hs b/test/Diffing/Algorithm/RWS/Spec.hs index a6700886f..2fb6ffa1f 100644 --- a/test/Diffing/Algorithm/RWS/Spec.hs +++ b/test/Diffing/Algorithm/RWS/Spec.hs @@ -41,3 +41,7 @@ spec = parallel $ do where decorate = defaultFeatureVectorDecorator diffThese = these deleting inserting replacing + +-- | Strips the head annotation off a term annotated with non-empty records. +stripTerm :: Functor f => Term f (Record (h ': t)) -> Term f (Record t) +stripTerm = fmap rtail