mirror of
https://github.com/github/semantic.git
synced 2024-12-24 07:25:44 +03:00
Cleanup redundant constraints
This commit is contained in:
parent
9a84cbdd97
commit
1b573a196f
@ -94,26 +94,29 @@ file :: MonadIO m => FilePath -> m Blob
|
||||
file path = fromJust <$> IO.readFile path (languageForFilePath path)
|
||||
|
||||
-- Diff helpers
|
||||
diffWithParser :: (HasField fields Data.Span.Span,
|
||||
HasField fields Range,
|
||||
Eq1 syntax, Show1 syntax,
|
||||
Traversable syntax, Functor syntax,
|
||||
Foldable syntax, Diffable syntax,
|
||||
GAlign syntax, HasDeclaration syntax)
|
||||
=>
|
||||
Parser (Term syntax (Record fields))
|
||||
-> BlobPair
|
||||
-> Task (Diff syntax (Record (Maybe Declaration ': fields)) (Record (Maybe Declaration ': fields)))
|
||||
diffWithParser ::
|
||||
( HasField fields Data.Span.Span
|
||||
, HasField fields Range
|
||||
, Eq1 syntax
|
||||
, Show1 syntax
|
||||
, Traversable syntax
|
||||
, Diffable syntax
|
||||
, GAlign syntax
|
||||
, HasDeclaration syntax
|
||||
)
|
||||
=> Parser (Term syntax (Record fields))
|
||||
-> BlobPair
|
||||
-> Task (Diff syntax (Record (Maybe Declaration ': fields)) (Record (Maybe Declaration ': fields)))
|
||||
diffWithParser parser = run (\ blob -> parse parser blob >>= decorate (declarationAlgebra blob))
|
||||
where
|
||||
run parse blobs = bidistributeFor (runJoin blobs) parse parse >>= diffTermPair diffTerms
|
||||
|
||||
diffBlobWithParser :: (HasField fields Data.Span.Span,
|
||||
HasField fields Range,
|
||||
Eq1 syntax, Show1 syntax,
|
||||
Traversable syntax, Functor syntax,
|
||||
Foldable syntax, Diffable syntax,
|
||||
GAlign syntax, HasDeclaration syntax)
|
||||
diffBlobWithParser ::
|
||||
( HasField fields Data.Span.Span
|
||||
, HasField fields Range
|
||||
, Traversable syntax
|
||||
, HasDeclaration syntax
|
||||
)
|
||||
=> Parser (Term syntax (Record fields))
|
||||
-> Blob
|
||||
-> Task (Term syntax (Record (Maybe Declaration : fields)))
|
||||
|
Loading…
Reference in New Issue
Block a user