From cea38b06f337dac71f2a9e7414bc25a9c97471da Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 10 Aug 2016 09:55:38 -0400 Subject: [PATCH] :fire: decorateParser. --- src/Diffing.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Diffing.hs b/src/Diffing.hs index b70ca0019..8a70b2506 100644 --- a/src/Diffing.hs +++ b/src/Diffing.hs @@ -117,10 +117,6 @@ readAndTranscodeFile path = do -- | A function computing a value to decorate terms with. This can be used to cache synthesized attributes on terms. type TermDecorator f fields field = CofreeF f (Record fields) (Record (field ': fields)) -> field --- | Decorate the 'Term's produced by a 'Parser' using a function to compute the annotation values at every node. -decorateParser :: Functor f => TermDecorator f fields field -> Parser f (Record fields) -> Parser f (Record (field ': fields)) -decorateParser decorator = (fmap (decorateTerm decorator) .) - -- | Decorate a 'Term' using a function to compute the annotation values at every node. decorateTerm :: Functor f => TermDecorator f fields field -> Cofree f (Record fields) -> Cofree f (Record (field ': fields)) decorateTerm decorator = cata $ \ c -> cofree ((decorator (extract <$> c) .: headF c) :< tailF c)