diff --git a/src/Semantic/Api/Diffs.hs b/src/Semantic/Api/Diffs.hs index 40a426022..8831df4e2 100644 --- a/src/Semantic/Api/Diffs.hs +++ b/src/Semantic/Api/Diffs.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, ConstraintKinds, LambdaCase, RankNTypes, UndecidableInstances #-} +{-# LANGUAGE GADTs, ConstraintKinds, LambdaCase, KindSignatures, RankNTypes, TypeOperators, UndecidableInstances, UndecidableSuperClasses #-} module Semantic.Api.Diffs ( parseDiffBuilder , DiffOutputFormat(..) @@ -26,6 +26,7 @@ import Data.Blob import Data.ByteString.Builder import Data.Graph import Data.JSON.Fields +import Data.Kind (Constraint) import Data.Language import Data.Term import qualified Data.Text as T @@ -188,6 +189,12 @@ doDiff decorate render blobPair = do diff <- diffTerms blobPair terms render diff +class (c1 term, c2 term) => ((c1 :: (* -> *) -> Constraint) & (c2 :: (* -> *) -> Constraint)) (term :: * -> *) + +infixl 9 & + +instance (c1 term, c2 term) => (c1 & c2) term + diffTerms :: (DiffTerms term, Member Telemetry sig, Carrier sig m, MonadIO m) => BlobPair -> Join These (term ann) -> m (DiffFor term ann ann) diffTerms blobs terms = time "diff" languageTag $ do