1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Assign wildcards _ in type positions

This commit is contained in:
Rick Winfrey 2018-06-19 15:15:53 -07:00
parent 66c28dd142
commit 1ca5894806
2 changed files with 14 additions and 0 deletions

View File

@ -121,6 +121,7 @@ type Syntax = '[
, Syntax.TypeSynonym , Syntax.TypeSynonym
, Syntax.UnitConstructor , Syntax.UnitConstructor
, Syntax.VariableSymbol , Syntax.VariableSymbol
, Syntax.Wildcard
, Type.TypeParameters , Type.TypeParameters
, [] , []
] ]
@ -341,6 +342,7 @@ expressionChoices = [
, variableOperator , variableOperator
, variableSymbol , variableSymbol
, where' , where'
, wildcard
] ]
fields :: Assignment fields :: Assignment
@ -750,6 +752,9 @@ variableIdentifiers = makeTerm <$> location <*> many variableIdentifier
where' :: Assignment where' :: Assignment
where' = makeTerm <$> (symbol Where <|> symbol Where') <*> children (manyTerm expression) where' = makeTerm <$> (symbol Where <|> symbol Where') <*> children (manyTerm expression)
wildcard :: Assignment
wildcard = makeTerm <$> token Wildcard <*> pure Syntax.Wildcard
-- | Helpers -- | Helpers
commentedTerm :: Assignment -> Assignment commentedTerm :: Assignment -> Assignment

View File

@ -755,3 +755,12 @@ instance Ord1 KindTupleType where liftCompare = genericLiftCompare
instance Show1 KindTupleType where liftShowsPrec = genericLiftShowsPrec instance Show1 KindTupleType where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable KindTupleType instance Evaluatable KindTupleType
data Wildcard a = Wildcard
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
instance Eq1 Wildcard where liftEq = genericLiftEq
instance Ord1 Wildcard where liftCompare = genericLiftCompare
instance Show1 Wildcard where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Wildcard