diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 2662b5157..c4fea7949 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -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 diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index 8489f98f2..6ca752d7b 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -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)