mirror of
https://github.com/github/semantic.git
synced 2025-01-04 13:34:31 +03:00
Generalize makeTerm over the term type.
This commit is contained in:
parent
811e740e1f
commit
15077437f2
@ -25,7 +25,7 @@ import qualified Data.Abstract.ScopeGraph as ScopeGraph
|
||||
-- Combinators
|
||||
|
||||
-- | Lift syntax and an annotation into a term, injecting the syntax into a union & ensuring the annotation encompasses all children.
|
||||
makeTerm :: (HasCallStack, Element syntax syntaxes, Semigroup ann, Apply Foldable syntaxes) => ann -> syntax (Term (Sum syntaxes) ann) -> Term (Sum syntaxes) ann
|
||||
makeTerm :: (HasCallStack, Element syntax syntaxes, Sum syntaxes ~ Syntax term, Semigroup ann, Apply Foldable syntaxes, IsTerm term) => ann -> syntax (term ann) -> term ann
|
||||
makeTerm ann = makeTerm' ann . inject
|
||||
|
||||
-- | Lift a union and an annotation into a term, ensuring the annotation encompasses all children.
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.Go.Assignment
|
||||
( assignment
|
||||
, Go.Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.Markdown.Assignment
|
||||
( assignment
|
||||
, Markdown.Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.PHP.Assignment
|
||||
( assignment
|
||||
, PHP.Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.Python.Assignment
|
||||
( assignment
|
||||
, Python.Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.Ruby.Assignment
|
||||
( assignment
|
||||
, Ruby.Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.TSX.Assignment
|
||||
( assignment
|
||||
, TSX.Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
|
||||
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
|
||||
module Language.TypeScript.Assignment
|
||||
( assignment
|
||||
, TypeScript.Syntax
|
||||
|
Loading…
Reference in New Issue
Block a user