1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Assign strict patterns

This commit is contained in:
Rick Winfrey 2018-06-20 15:57:15 -07:00
parent aad0bd3210
commit 89d81c4236
2 changed files with 12 additions and 16 deletions

View File

@ -120,8 +120,7 @@ type Syntax = '[
, Syntax.Splice
, Syntax.StandaloneDerivingInstance
, Syntax.Star
, Syntax.StrictType
, Syntax.StrictTypeVariable
, Syntax.Strict
, Syntax.Tuple
, Syntax.TupleConstructor
, Syntax.TuplePattern
@ -366,6 +365,7 @@ expressionChoices = [
, splice
, standaloneDerivingInstance
, star
, strictPattern
, strictType
, string
, tuple
@ -720,6 +720,9 @@ standaloneDerivingInstance = makeTerm <$> symbol StandaloneDerivingDeclaration <
star :: Assignment
star = makeTerm <$> token Star <*> pure Syntax.Star
strictPattern :: Assignment
strictPattern = makeTerm <$> symbol StrictPattern <*> children (Syntax.StrictPattern <$> expression)
strictType :: Assignment
strictType = makeTerm'
<$> symbol StrictType

View File

@ -20,23 +20,16 @@ instance Show1 Module where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Module
data StrictType a = StrictType { strictTypeIdentifier :: !a, strictTypeParameters :: !a }
data Strict a = StrictPattern a
| StrictType { strictTypeIdentifier :: a, strictTypeParameters :: a }
| StrictTypeVariable a
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
instance Eq1 StrictType where liftEq = genericLiftEq
instance Ord1 StrictType where liftCompare = genericLiftCompare
instance Show1 StrictType where liftShowsPrec = genericLiftShowsPrec
instance Eq1 Strict where liftEq = genericLiftEq
instance Ord1 Strict where liftCompare = genericLiftCompare
instance Show1 Strict where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable StrictType
newtype StrictTypeVariable a = StrictTypeVariable { strictTypeVariableIdentifier :: a }
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
instance Eq1 StrictTypeVariable where liftEq = genericLiftEq
instance Ord1 StrictTypeVariable where liftCompare = genericLiftCompare
instance Show1 StrictTypeVariable where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable StrictTypeVariable
instance Evaluatable Strict
data Type a = Type { typeIdentifier :: a, typeParameters :: a, typeKindSignature :: a }
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)