mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Add a function to decorate a term with the assistance of a decorating function.
This commit is contained in:
parent
30ef58c6fd
commit
96c728a9ca
@ -77,6 +77,9 @@ readAndTranscodeFile path = do
|
|||||||
text <- B1.readFile path
|
text <- B1.readFile path
|
||||||
transcode text
|
transcode text
|
||||||
|
|
||||||
|
decorateTerm :: Functor f => (CofreeF f (Record fields) (Record (field ': fields)) -> field) -> Cofree f (Record fields) -> Cofree f (Record (field ': fields))
|
||||||
|
decorateTerm decorator = cata $ \ c -> cofree ((decorator (extract <$> c) .: headF c) :< tailF c)
|
||||||
|
|
||||||
-- | Given a parser and renderer, diff two sources and return the rendered
|
-- | Given a parser and renderer, diff two sources and return the rendered
|
||||||
-- | result.
|
-- | result.
|
||||||
-- | Returns the rendered result strictly, so it's always fully evaluated
|
-- | Returns the rendered result strictly, so it's always fully evaluated
|
||||||
|
Loading…
Reference in New Issue
Block a user