From 6fcc0fe981595ac5b639e272848302fc1284e39a Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 22 Jun 2018 16:47:16 -0700 Subject: [PATCH] Add labeled construction syntax --- src/Language/Haskell/Syntax.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index 0dd5321c8..dfa1afd3c 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -908,3 +908,12 @@ instance Ord1 PatternGuard where liftCompare = genericLiftCompare instance Show1 PatternGuard where liftShowsPrec = genericLiftShowsPrec instance Evaluatable PatternGuard + +data LabeledConstruction a = LabeledConstruction { labeledConstructionConstructor :: a, labeledConstructionFields :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 LabeledConstruction where liftEq = genericLiftEq +instance Ord1 LabeledConstruction where liftCompare = genericLiftCompare +instance Show1 LabeledConstruction where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable LabeledConstruction