1
1
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:
Rob Rix 2019-10-18 18:59:47 -04:00
parent 811e740e1f
commit 15077437f2
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
8 changed files with 8 additions and 8 deletions

View File

@ -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.

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.Go.Assignment
( assignment
, Go.Syntax

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.Markdown.Assignment
( assignment
, Markdown.Syntax

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.PHP.Assignment
( assignment
, PHP.Syntax

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.Python.Assignment
( assignment
, Python.Syntax

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.Ruby.Assignment
( assignment
, Ruby.Syntax

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.TSX.Assignment
( assignment
, TSX.Syntax

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeFamilies, TypeOperators #-}
module Language.TypeScript.Assignment
( assignment
, TypeScript.Syntax