From 1b573a196ffd6a32946c4f156270d825f08754ce Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 16 Mar 2018 10:50:26 -0700 Subject: [PATCH] Cleanup redundant constraints --- src/Semantic/Util.hs | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/Semantic/Util.hs b/src/Semantic/Util.hs index e41b90f52..0d8520ec7 100644 --- a/src/Semantic/Util.hs +++ b/src/Semantic/Util.hs @@ -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)))