@@ -50,7 +50,7 @@ data TypeSearch
5050 -- ^ Record fields that are available on the first argument to the typed
5151 -- hole
5252 }
53- deriving (Show , Generic , NFData )
53+ deriving (Show , Generic , NFData , Serialise )
5454
5555onTypeSearchTypes :: (SourceType -> SourceType ) -> TypeSearch -> TypeSearch
5656onTypeSearchTypes f = runIdentity . onTypeSearchTypesM (Identity . f)
@@ -90,7 +90,7 @@ data ErrorMessageHint
9090 | MissingConstructorImportForCoercible (Qualified (ProperName 'ConstructorName))
9191 | PositionedError (NEL. NonEmpty SourceSpan )
9292 | RelatedPositions (NEL. NonEmpty SourceSpan )
93- deriving (Show , Generic , NFData )
93+ deriving (Show , Generic , NFData , Serialise )
9494
9595-- | Categories of hints
9696data HintCategory
@@ -112,7 +112,7 @@ data UnknownsHint
112112 = NoUnknowns
113113 | Unknowns
114114 | UnknownsWithVtaRequiringArgs (NEL. NonEmpty (Qualified Ident , [[Text ]]))
115- deriving (Show , Generic , NFData )
115+ deriving (Show , Generic , NFData , Serialise )
116116
117117-- |
118118-- A module declaration, consisting of comments about the module, a module name,
@@ -165,7 +165,7 @@ importPrim =
165165 . addDefaultImport (Qualified ByNullSourcePos primModName)
166166
167167data NameSource = UserNamed | CompilerNamed
168- deriving (Show , Generic , NFData , Serialise )
168+ deriving (Eq , Show , Generic , NFData , Serialise )
169169
170170-- |
171171-- An item in a list of explicit imports or exports
@@ -323,7 +323,7 @@ data RoleDeclarationData = RoleDeclarationData
323323 { rdeclSourceAnn :: ! SourceAnn
324324 , rdeclIdent :: ! (ProperName 'TypeName)
325325 , rdeclRoles :: ! [Role ]
326- } deriving (Show , Eq , Generic , NFData )
326+ } deriving (Show , Eq , Generic , NFData , Serialise )
327327
328328-- | A type declaration assigns a type to an identifier, eg:
329329--
@@ -334,7 +334,7 @@ data TypeDeclarationData = TypeDeclarationData
334334 { tydeclSourceAnn :: ! SourceAnn
335335 , tydeclIdent :: ! Ident
336336 , tydeclType :: ! SourceType
337- } deriving (Show , Eq , Generic , NFData )
337+ } deriving (Show , Eq , Generic , NFData , Serialise )
338338
339339getTypeDeclaration :: Declaration -> Maybe TypeDeclarationData
340340getTypeDeclaration (TypeDeclaration d) = Just d
@@ -356,7 +356,7 @@ data ValueDeclarationData a = ValueDeclarationData
356356 -- ^ Whether or not this value is exported/visible
357357 , valdeclBinders :: ! [Binder ]
358358 , valdeclExpression :: ! a
359- } deriving (Show , Functor , Generic , NFData , Foldable , Traversable )
359+ } deriving (Show , Functor , Generic , NFData , Foldable , Traversable , Serialise )
360360
361361getValueDeclaration :: Declaration -> Maybe (ValueDeclarationData [GuardedExpr ])
362362getValueDeclaration (ValueDeclaration d) = Just d
@@ -370,7 +370,7 @@ data DataConstructorDeclaration = DataConstructorDeclaration
370370 { dataCtorAnn :: ! SourceAnn
371371 , dataCtorName :: ! (ProperName 'ConstructorName)
372372 , dataCtorFields :: ! [(Ident , SourceType )]
373- } deriving (Show , Eq , Generic , NFData )
373+ } deriving (Show , Eq , Generic , NFData , Serialise )
374374
375375mapDataCtorFields :: ([(Ident , SourceType )] -> [(Ident , SourceType )]) -> DataConstructorDeclaration -> DataConstructorDeclaration
376376mapDataCtorFields f DataConstructorDeclaration {.. } = DataConstructorDeclaration { dataCtorFields = f dataCtorFields, .. }
@@ -445,13 +445,13 @@ data Declaration
445445 -- declaration, while the second @SourceAnn@ serves as the
446446 -- annotation for the type class and its arguments.
447447 | TypeInstanceDeclaration SourceAnn SourceAnn ChainId Integer (Either Text Ident ) [SourceConstraint ] (Qualified (ProperName 'ClassName)) [SourceType ] TypeInstanceBody
448- deriving (Show , Generic , NFData )
448+ deriving (Show , Generic , NFData , Serialise )
449449
450450data ValueFixity = ValueFixity Fixity (Qualified (Either Ident (ProperName 'ConstructorName))) (OpName 'ValueOpName)
451- deriving (Eq , Ord , Show , Generic , NFData )
451+ deriving (Eq , Ord , Show , Generic , NFData , Serialise )
452452
453453data TypeFixity = TypeFixity Fixity (Qualified (ProperName 'TypeName)) (OpName 'TypeOpName)
454- deriving (Eq , Ord , Show , Generic , NFData )
454+ deriving (Eq , Ord , Show , Generic , NFData , Serialise )
455455
456456pattern ValueFixityDeclaration :: SourceAnn -> Fixity -> Qualified (Either Ident (ProperName 'ConstructorName)) -> OpName 'ValueOpName -> Declaration
457457pattern ValueFixityDeclaration sa fixity name op = FixityDeclaration sa (Left (ValueFixity fixity name op))
@@ -462,7 +462,7 @@ pattern TypeFixityDeclaration sa fixity name op = FixityDeclaration sa (Right (T
462462data InstanceDerivationStrategy
463463 = KnownClassStrategy
464464 | NewtypeStrategy
465- deriving (Show , Generic , NFData )
465+ deriving (Show , Generic , NFData , Serialise )
466466
467467-- | The members of a type class instance declaration
468468data TypeInstanceBody
@@ -472,7 +472,7 @@ data TypeInstanceBody
472472 -- ^ This is an instance derived from a newtype
473473 | ExplicitInstance [Declaration ]
474474 -- ^ This is a regular (explicit) instance
475- deriving (Show , Generic , NFData )
475+ deriving (Show , Generic , NFData , Serialise )
476476
477477mapTypeInstanceBody :: ([Declaration ] -> [Declaration ]) -> TypeInstanceBody -> TypeInstanceBody
478478mapTypeInstanceBody f = runIdentity . traverseTypeInstanceBody (Identity . f)
@@ -488,7 +488,7 @@ data KindSignatureFor
488488 | NewtypeSig
489489 | TypeSynonymSig
490490 | ClassSig
491- deriving (Eq , Ord , Show , Generic , NFData )
491+ deriving (Eq , Ord , Show , Generic , NFData , Serialise )
492492
493493declSourceAnn :: Declaration -> SourceAnn
494494declSourceAnn (DataDeclaration sa _ _ _ _) = sa
@@ -625,13 +625,13 @@ flattenDecls = concatMap flattenOne
625625--
626626data Guard = ConditionGuard Expr
627627 | PatternGuard Binder Expr
628- deriving (Show , Generic , NFData )
628+ deriving (Show , Generic , NFData , Serialise )
629629
630630-- |
631631-- The right hand side of a binder in value declarations
632632-- and case expressions.
633633data GuardedExpr = GuardedExpr [Guard ] Expr
634- deriving (Show , Generic , NFData )
634+ deriving (Show , Generic , NFData , Serialise )
635635
636636pattern MkUnguarded :: Expr -> GuardedExpr
637637pattern MkUnguarded e = GuardedExpr [] e
@@ -762,7 +762,7 @@ data Expr
762762 -- A value with source position information
763763 --
764764 | PositionedValue SourceSpan [Comment ] Expr
765- deriving (Show , Generic , NFData )
765+ deriving (Show , Generic , NFData , Serialise )
766766
767767-- |
768768-- Metadata that tells where a let binding originated
@@ -776,7 +776,7 @@ data WhereProvenance
776776 -- The let binding was always a let binding
777777 --
778778 | FromLet
779- deriving (Show , Generic , NFData )
779+ deriving (Show , Generic , NFData , Serialise )
780780
781781-- |
782782-- An alternative in a case statement
@@ -790,7 +790,7 @@ data CaseAlternative = CaseAlternative
790790 -- The result expression or a collect of guarded expressions
791791 --
792792 , caseAlternativeResult :: [GuardedExpr ]
793- } deriving (Show , Generic , NFData )
793+ } deriving (Show , Generic , NFData , Serialise )
794794
795795-- |
796796-- A statement in a do-notation block
@@ -812,7 +812,7 @@ data DoNotationElement
812812 -- A do notation element with source position information
813813 --
814814 | PositionedDoNotationElement SourceSpan [Comment ] DoNotationElement
815- deriving (Show , Generic , NFData )
815+ deriving (Show , Generic , NFData , Serialise )
816816
817817
818818-- For a record update such as:
@@ -839,15 +839,16 @@ data DoNotationElement
839839--
840840
841841newtype PathTree t = PathTree (AssocList PSString (PathNode t ))
842- deriving (Show , Eq , Ord , Functor , Foldable , Traversable )
843- deriving newtype NFData
842+ deriving (Show , Eq , Ord , Functor , Foldable , Traversable , Generic )
843+ deriving newtype (NFData , Serialise )
844+
844845
845846data PathNode t = Leaf t | Branch (PathTree t )
846- deriving (Show , Eq , Ord , Generic , NFData , Functor , Foldable , Traversable )
847+ deriving (Show , Eq , Ord , Generic , NFData , Functor , Foldable , Traversable , Serialise )
847848
848849newtype AssocList k t = AssocList { runAssocList :: [(k , t )] }
849- deriving (Show , Eq , Ord , Foldable , Functor , Traversable )
850- deriving newtype NFData
850+ deriving (Show , Eq , Ord , Foldable , Functor , Traversable , Generic )
851+ deriving newtype ( NFData , Serialise )
851852
852853$ (deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''NameSource)
853854$ (deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''ExportSource)
0 commit comments