@@ -1,4 +1,3 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE ScopedTypeVariables #-}
1{-# LANGUAGE ScopedTypeVariables #-}
3{-# LANGUAGE TemplateHaskell #-}
2{-# LANGUAGE TemplateHaskell #-}
4{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE LambdaCase #-}
@@ -15,7 +14,6 @@ import Data.Aeson.TH
15import Data.List (nub, (\\))
14import Data.List (nub, (\\))
16import Data.Maybe (mapMaybe)
15import Data.Maybe (mapMaybe)
18−import qualified Data.Data as D
19import qualified Data.Map as M
17import qualified Data.Map as M
21import Control.Monad.Identity
19import Control.Monad.Identity
@@ -35,7 +33,8 @@ import Language.PureScript.Environment
35-- a list of declarations, and a list of the declarations that are
33-- a list of declarations, and a list of the declarations that are
36-- explicitly exported. If the export list is Nothing, everything is exported.
34-- explicitly exported. If the export list is Nothing, everything is exported.
38−data Module = Module SourceSpan [Comment] ModuleName [Declaration] (Maybe [DeclarationRef]) deriving (Show, Read, D.Data, D.Typeable)
36+data Module = Module SourceSpan [Comment] ModuleName [Declaration] (Maybe [DeclarationRef])
37+ deriving (Show, Read)
40-- | Return a module's name.
39-- | Return a module's name.
41getModuleName :: Module -> ModuleName
40getModuleName :: Module -> ModuleName
@@ -85,7 +84,7 @@ data DeclarationRef
85 -- A declaration reference with source position information
84 -- A declaration reference with source position information
87 | PositionedDeclarationRef SourceSpan [Comment] DeclarationRef
86 | PositionedDeclarationRef SourceSpan [Comment] DeclarationRef
88− deriving (Show, Read, D.Data, D.Typeable)
87+ deriving (Show, Read)
90instance Eq DeclarationRef where
89instance Eq DeclarationRef where
91 (TypeRef name dctors) == (TypeRef name' dctors') = name == name' && dctors == dctors'
90 (TypeRef name dctors) == (TypeRef name' dctors') = name == name' && dctors == dctors'
@@ -141,7 +140,7 @@ data ImportDeclarationType
141 -- An import with a list of references to hide: `import M hiding (foo)`
140 -- An import with a list of references to hide: `import M hiding (foo)`
143 | Hiding [DeclarationRef]
142 | Hiding [DeclarationRef]
144− deriving (Eq, Show, Read, D.Data, D.Typeable)
143+ deriving (Eq, Show, Read)
146isImplicit :: ImportDeclarationType -> Bool
145isImplicit :: ImportDeclarationType -> Bool
147isImplicit Implicit = True
146isImplicit Implicit = True
@@ -205,7 +204,7 @@ data Declaration
205 -- A declaration with source position information
204 -- A declaration with source position information
207 | PositionedDeclaration SourceSpan [Comment] Declaration
206 | PositionedDeclaration SourceSpan [Comment] Declaration
208− deriving (Show, Read, D.Data, D.Typeable)
207+ deriving (Show, Read)
210-- | The members of a type class instance declaration
209-- | The members of a type class instance declaration
211data TypeInstanceBody
210data TypeInstanceBody
@@ -213,7 +212,7 @@ data TypeInstanceBody
213 = DerivedInstance
212 = DerivedInstance
214 -- | This is a regular (explicit) instance
213 -- | This is a regular (explicit) instance
215 | ExplicitInstance [Declaration]
214 | ExplicitInstance [Declaration]
216− deriving (Show, Read, D.Data, D.Typeable)
215+ deriving (Show, Read)
218mapTypeInstanceBody :: ([Declaration] -> [Declaration]) -> TypeInstanceBody -> TypeInstanceBody
217mapTypeInstanceBody :: ([Declaration] -> [Declaration]) -> TypeInstanceBody -> TypeInstanceBody
219mapTypeInstanceBody f = runIdentity . traverseTypeInstanceBody (Identity . f)
218mapTypeInstanceBody f = runIdentity . traverseTypeInstanceBody (Identity . f)
@@ -432,7 +431,8 @@ data Expr
433 -- A value with source position information
432 -- A value with source position information
435− | PositionedValue SourceSpan [Comment] Expr deriving (Show, Read, D.Data, D.Typeable)
434+ | PositionedValue SourceSpan [Comment] Expr
435+ deriving (Show, Read)
438-- An alternative in a case statement
438-- An alternative in a case statement
@@ -446,7 +446,7 @@ data CaseAlternative = CaseAlternative
446 -- The result expression or a collect of guarded expressions
446 -- The result expression or a collect of guarded expressions
448 , caseAlternativeResult :: Either [(Guard, Expr)] Expr
448 , caseAlternativeResult :: Either [(Guard, Expr)] Expr
449− } deriving (Show, Read, D.Data, D.Typeable)
449+ } deriving (Show, Read)
452-- A statement in a do-notation block
452-- A statement in a do-notation block
@@ -467,7 +467,8 @@ data DoNotationElement
468 -- A do notation element with source position information
468 -- A do notation element with source position information
470− | PositionedDoNotationElement SourceSpan [Comment] DoNotationElement deriving (Show, Read, D.Data, D.Typeable)
470+ | PositionedDoNotationElement SourceSpan [Comment] DoNotationElement
471+ deriving (Show, Read)
472$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''DeclarationRef)
473$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''DeclarationRef)
473$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''ImportDeclarationType)
474$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''ImportDeclarationType)