1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Generalize diffWithParser.

This commit is contained in:
Rob Rix 2018-04-04 17:03:56 -04:00
parent 8584e380b5
commit b084401126

View File

@ -244,8 +244,9 @@ diffWithParser :: ( HasField fields Data.Span.Span
, Diffable syntax
, GAlign syntax
, HasDeclaration syntax
, Members '[Distribute WrappedTask, TaskF] effs
)
=> Parser (Term syntax (Record fields))
-> BlobPair
-> Task (Diff syntax (Record (Maybe Declaration ': fields)) (Record (Maybe Declaration ': fields)))
-> Eff effs (Diff syntax (Record (Maybe Declaration ': fields)) (Record (Maybe Declaration ': fields)))
diffWithParser parser blobs = distributeFor blobs (\ blob -> WrapTask $ parse parser blob >>= decorate (declarationAlgebra blob)) >>= diffTermPair diffTerms . runJoin