git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Remove Data/Typeable deriving
d1a956dGary Burgess
src/Language/PureScript/AST/Binders.hs+2−5
@@ -1,12 +1,8 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−
3-- |
1-- |
4-- Case binders
2-- Case binders
5--
3--
6module Language.PureScript.AST.Binders where
4module Language.PureScript.AST.Binders where
7
5
8−import qualified Data.Data as D
9−
10import Language.PureScript.AST.SourcePos
6import Language.PureScript.AST.SourcePos
11import Language.PureScript.Names
7import Language.PureScript.Names
12import Language.PureScript.Comments
8import Language.PureScript.Comments
@@ -63,7 +59,8 @@ data Binder
63 -- |
59 -- |
64 -- A binder with a type annotation
60 -- A binder with a type annotation
65 --
61 --
66− | TypedBinder Type Binder deriving (Show, Read, Eq, D.Data, D.Typeable)
62+ | TypedBinder Type Binder
63+ deriving (Show, Read, Eq)
67
64
68-- |
65-- |
69-- Collect all names introduced in binders in an expression
66-- Collect all names introduced in binders in an expression
src/Language/PureScript/AST/Declarations.hs+11−10
@@ -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)
17
16
18−import qualified Data.Data as D
19import qualified Data.Map as M
17import qualified Data.Map as M
20
18
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.
37--
35--
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)
39
38
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
86 --
85 --
87 | PositionedDeclarationRef SourceSpan [Comment] DeclarationRef
86 | PositionedDeclarationRef SourceSpan [Comment] DeclarationRef
88− deriving (Show, Read, D.Data, D.Typeable)
87+ deriving (Show, Read)
89
88
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)`
142 --
141 --
143 | Hiding [DeclarationRef]
142 | Hiding [DeclarationRef]
144− deriving (Eq, Show, Read, D.Data, D.Typeable)
143+ deriving (Eq, Show, Read)
145
144
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
206 --
205 --
207 | PositionedDeclaration SourceSpan [Comment] Declaration
206 | PositionedDeclaration SourceSpan [Comment] Declaration
208− deriving (Show, Read, D.Data, D.Typeable)
207+ deriving (Show, Read)
209
208
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)
217
216
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
432 -- |
431 -- |
433 -- A value with source position information
432 -- A value with source position information
434 --
433 --
435− | PositionedValue SourceSpan [Comment] Expr deriving (Show, Read, D.Data, D.Typeable)
434+ | PositionedValue SourceSpan [Comment] Expr
435+ deriving (Show, Read)
436
436
437-- |
437-- |
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
447 --
447 --
448 , caseAlternativeResult :: Either [(Guard, Expr)] Expr
448 , caseAlternativeResult :: Either [(Guard, Expr)] Expr
449− } deriving (Show, Read, D.Data, D.Typeable)
449+ } deriving (Show, Read)
450
450
451-- |
451-- |
452-- A statement in a do-notation block
452-- A statement in a do-notation block
@@ -467,7 +467,8 @@ data DoNotationElement
467 -- |
467 -- |
468 -- A do notation element with source position information
468 -- A do notation element with source position information
469 --
469 --
470− | PositionedDoNotationElement SourceSpan [Comment] DoNotationElement deriving (Show, Read, D.Data, D.Typeable)
470+ | PositionedDoNotationElement SourceSpan [Comment] DoNotationElement
471+ deriving (Show, Read)
471
472
472$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''DeclarationRef)
473$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''DeclarationRef)
473$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''ImportDeclarationType)
474$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''ImportDeclarationType)
src/Language/PureScript/AST/Operators.hs+7−18
@@ -1,23 +1,10 @@
1−-----------------------------------------------------------------------------
2−--
3−-- Module : Language.PureScript.AST.Operators
4−-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
5−-- License : MIT
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>
8−-- Stability : experimental
9−-- Portability :
10−--
11−-- | Operators fixity and associativity
12−--
13−-----------------------------------------------------------------------------
14−
15{-# LANGUAGE OverloadedStrings #-}
1{-# LANGUAGE OverloadedStrings #-}
16−{-# LANGUAGE DeriveDataTypeable #-}
17
2
3+-- |
4+-- Operators fixity and associativity
5+--
18module Language.PureScript.AST.Operators where
6module Language.PureScript.AST.Operators where
19
7
20−import qualified Data.Data as D
21import Data.Aeson ((.=))
8import Data.Aeson ((.=))
22import qualified Data.Aeson as A
9import qualified Data.Aeson as A
23
10
@@ -31,7 +18,8 @@ type Precedence = Integer
31-- |
18-- |
32-- Associativity for infix operators
19-- Associativity for infix operators
33--
20--
34−data Associativity = Infixl | Infixr | Infix deriving (Show, Read, Eq, Ord, D.Data, D.Typeable)
21+data Associativity = Infixl | Infixr | Infix
22+ deriving (Show, Read, Eq, Ord)
35
23
36showAssoc :: Associativity -> String
24showAssoc :: Associativity -> String
37showAssoc Infixl = "infixl"
25showAssoc Infixl = "infixl"
@@ -53,7 +41,8 @@ instance A.FromJSON Associativity where
53-- |
41-- |
54-- Fixity data for infix operators
42-- Fixity data for infix operators
55--
43--
56−data Fixity = Fixity Associativity Precedence deriving (Show, Read, Eq, Ord, D.Data, D.Typeable)
44+data Fixity = Fixity Associativity Precedence
45+ deriving (Show, Read, Eq, Ord)
57
46
58instance A.ToJSON Fixity where
47instance A.ToJSON Fixity where
59 toJSON (Fixity associativity precedence) =
48 toJSON (Fixity associativity precedence) =
src/Language/PureScript/AST/SourcePos.hs+5−18
@@ -1,28 +1,15 @@
1−-----------------------------------------------------------------------------
2−--
3−-- Module : Language.PureScript.AST.SourcePos
4−-- Copyright : (c) 2013-15 Phil Freeman, (c) 2014-15 Gary Burgess
5−-- License : MIT (http://opensource.org/licenses/MIT)
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>
8−-- Stability : experimental
9−-- Portability :
10−--
11−-- | Source position information
12−--
13−-----------------------------------------------------------------------------
14−
15−{-# LANGUAGE DeriveDataTypeable #-}
16{-# LANGUAGE ScopedTypeVariables #-}
1{-# LANGUAGE ScopedTypeVariables #-}
17{-# LANGUAGE RecordWildCards #-}
2{-# LANGUAGE RecordWildCards #-}
18{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE OverloadedStrings #-}
19
4
5+-- |
6+-- Source position information
7+--
20module Language.PureScript.AST.SourcePos where
8module Language.PureScript.AST.SourcePos where
21
9
22import Prelude ()
10import Prelude ()
23import Prelude.Compat
11import Prelude.Compat
24
12
25−import qualified Data.Data as D
26import Data.Aeson ((.=), (.:))
13import Data.Aeson ((.=), (.:))
27import qualified Data.Aeson as A
14import qualified Data.Aeson as A
28
15
@@ -38,7 +25,7 @@ data SourcePos = SourcePos
38 -- Column number
25 -- Column number
39 --
26 --
40 , sourcePosColumn :: Int
27 , sourcePosColumn :: Int
41− } deriving (Show, Read, Eq, Ord, D.Data, D.Typeable)
28+ } deriving (Show, Read, Eq, Ord)
42
29
43displaySourcePos :: SourcePos -> String
30displaySourcePos :: SourcePos -> String
44displaySourcePos sp =
31displaySourcePos sp =
@@ -66,7 +53,7 @@ data SourceSpan = SourceSpan
66 -- End of the span
53 -- End of the span
67 --
54 --
68 , spanEnd :: SourcePos
55 , spanEnd :: SourcePos
69− } deriving (Show, Read, Eq, Ord, D.Data, D.Typeable)
56+ } deriving (Show, Read, Eq, Ord)
70
57
71displayStartEndPos :: SourceSpan -> String
58displayStartEndPos :: SourceSpan -> String
72displayStartEndPos sp =
59displayStartEndPos sp =
src/Language/PureScript/CodeGen/JS/AST.hs+6−18
@@ -1,27 +1,12 @@
1−-----------------------------------------------------------------------------
2−--
3−-- Module : Language.PureScript.CodeGen.JS.AST
4−-- Copyright : (c) Phil Freeman 2013
5−-- License : MIT
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>
8−-- Stability : experimental
9−-- Portability :
10−--
11-- |
1-- |
12-- Data types for the intermediate simplified-Javascript AST
2-- Data types for the intermediate simplified-Javascript AST
13--
3--
14−-----------------------------------------------------------------------------
15−
16−{-# LANGUAGE DeriveDataTypeable #-}
17−
18module Language.PureScript.CodeGen.JS.AST where
4module Language.PureScript.CodeGen.JS.AST where
19
5
20import Prelude ()
6import Prelude ()
21import Prelude.Compat
7import Prelude.Compat
22
8
23import Control.Monad.Identity
9import Control.Monad.Identity
24−import Data.Data
25
10
26import Language.PureScript.Comments
11import Language.PureScript.Comments
27import Language.PureScript.Traversals
12import Language.PureScript.Traversals
@@ -49,7 +34,8 @@ data UnaryOperator
49 -- |
34 -- |
50 -- Constructor
35 -- Constructor
51 --
36 --
37+ | JSNew
52− | JSNew deriving (Show, Read, Eq, Data, Typeable)
38+ deriving (Show, Read, Eq)
53
39
54-- |
40-- |
55-- Built-in binary operators
41-- Built-in binary operators
@@ -130,7 +116,8 @@ data BinaryOperator
130 -- |
116 -- |
131 -- Bitwise right shift with zero-fill
117 -- Bitwise right shift with zero-fill
132 --
118 --
133− | ZeroFillShiftRight deriving (Show, Read, Eq, Data, Typeable)
119+ | ZeroFillShiftRight
120+ deriving (Show, Read, Eq)
134
121
135-- |
122-- |
136-- Data type for simplified Javascript expressions
123-- Data type for simplified Javascript expressions
@@ -251,7 +238,8 @@ data JS
251 -- |
238 -- |
252 -- Commented Javascript
239 -- Commented Javascript
253 --
240 --
254− | JSComment [Comment] JS deriving (Show, Read, Eq, Data, Typeable)
241+ | JSComment [Comment] JS
242+ deriving (Show, Read, Eq)
255
243
256--
244--
257-- Traversals
245-- Traversals
src/Language/PureScript/Comments.hs+3−17
@@ -1,29 +1,15 @@
1−-----------------------------------------------------------------------------
1+{-# LANGUAGE TemplateHaskell #-}
2−--
2+
3−-- Module : Language.PureScript.Parser.Comments
4−-- Copyright : (c) Phil Freeman 2015
5−-- License : MIT
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>
8−-- Stability : experimental
9−-- Portability :
10−--
11-- |
3-- |
12-- Defines the types of source code comments
4-- Defines the types of source code comments
13--
5--
14−-----------------------------------------------------------------------------
15−
16−{-# LANGUAGE DeriveDataTypeable #-}
17−{-# LANGUAGE TemplateHaskell #-}
18−
19module Language.PureScript.Comments where
6module Language.PureScript.Comments where
20
7
21import Data.Aeson.TH
8import Data.Aeson.TH
22−import qualified Data.Data as D
23
9
24data Comment
10data Comment
25 = LineComment String
11 = LineComment String
26 | BlockComment String
12 | BlockComment String
27− deriving (Show, Read, Eq, Ord, D.Data, D.Typeable)
13+ deriving (Show, Read, Eq, Ord)
28
14
29$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''Comment)
15$(deriveJSON (defaultOptions { sumEncoding = ObjectWithSingleField }) ''Comment)
src/Language/PureScript/CoreFn/Binders.hs+2−4
@@ -1,4 +1,3 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE DeriveFunctor #-}
1{-# LANGUAGE DeriveFunctor #-}
3
2
4-- |
3-- |
@@ -6,8 +5,6 @@
6--
5--
7module Language.PureScript.CoreFn.Binders where
6module Language.PureScript.CoreFn.Binders where
8
7
9−import qualified Data.Data as D
10−
11import Language.PureScript.CoreFn.Literals
8import Language.PureScript.CoreFn.Literals
12import Language.PureScript.Names
9import Language.PureScript.Names
13
10
@@ -34,4 +31,5 @@ data Binder a
34 -- |
31 -- |
35 -- A binder which binds its input to an identifier
32 -- A binder which binds its input to an identifier
36 --
33 --
37− | NamedBinder a Ident (Binder a) deriving (Show, Read, D.Data, D.Typeable, Functor)
34+ | NamedBinder a Ident (Binder a)
35+ deriving (Show, Read, Functor)
src/Language/PureScript/CoreFn/Expr.hs+6−6
@@ -1,4 +1,3 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE DeriveFunctor #-}
1{-# LANGUAGE DeriveFunctor #-}
3
2
4-- |
3-- |
@@ -8,8 +7,6 @@ module Language.PureScript.CoreFn.Expr where
8
7
9import Control.Arrow ((***))
8import Control.Arrow ((***))
10
9
11−import qualified Data.Data as D
12−
13import Language.PureScript.CoreFn.Binders
10import Language.PureScript.CoreFn.Binders
14import Language.PureScript.CoreFn.Literals
11import Language.PureScript.CoreFn.Literals
15import Language.PureScript.Names
12import Language.PureScript.Names
@@ -53,7 +50,8 @@ data Expr a
53 -- |
50 -- |
54 -- A let binding
51 -- A let binding
55 --
52 --
53+ | Let a [Bind a] (Expr a)
56− | Let a [Bind a] (Expr a) deriving (Show, Read, D.Data, D.Typeable, Functor)
54+ deriving (Show, Read, Functor)
57
55
58-- |
56-- |
59-- A let or module binding.
57-- A let or module binding.
@@ -66,7 +64,8 @@ data Bind a
66 -- |
64 -- |
67 -- Mutually recursive binding group for several values
65 -- Mutually recursive binding group for several values
68 --
66 --
67+ | Rec [(Ident, Expr a)]
69− | Rec [(Ident, Expr a)] deriving (Show, Read, D.Data, D.Typeable, Functor)
68+ deriving (Show, Read, Functor)
70
69
71-- |
70-- |
72-- A guard is just a boolean-valued expression that appears alongside a set of binders
71-- A guard is just a boolean-valued expression that appears alongside a set of binders
@@ -85,7 +84,8 @@ data CaseAlternative a = CaseAlternative
85 -- The result expression or a collect of guarded expressions
84 -- The result expression or a collect of guarded expressions
86 --
85 --
87 , caseAlternativeResult :: Either [(Guard a, Expr a)] (Expr a)
86 , caseAlternativeResult :: Either [(Guard a, Expr a)] (Expr a)
87+ }
88− } deriving (Show, Read, D.Data, D.Typeable)
88+ deriving (Show, Read)
89
89
90instance Functor CaseAlternative where
90instance Functor CaseAlternative where
91
91
src/Language/PureScript/CoreFn/Literals.hs+5−18
@@ -1,24 +1,10 @@
1−-----------------------------------------------------------------------------
2−--
3−-- Module : Language.PureScript.CoreFn.Literals
4−-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
5−-- License : MIT
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>, Gary Burgess <gary.burgess@gmail.com>
8−-- Stability : experimental
9−-- Portability :
10−--
11−-- | The core functional representation for literal values.
12−--
13−-----------------------------------------------------------------------------
14−
15−{-# LANGUAGE DeriveDataTypeable #-}
16{-# LANGUAGE DeriveFunctor #-}
1{-# LANGUAGE DeriveFunctor #-}
17
2
3+-- |
4+-- The core functional representation for literal values.
5+--
18module Language.PureScript.CoreFn.Literals where
6module Language.PureScript.CoreFn.Literals where
19
7
20−import qualified Data.Data as D
21−
22-- |
8-- |
23-- Data type for literal values. Parameterised so it can be used for Exprs and
9-- Data type for literal values. Parameterised so it can be used for Exprs and
24-- Binders.
10-- Binders.
@@ -47,4 +33,5 @@ data Literal a
47 -- |
33 -- |
48 -- An object literal
34 -- An object literal
49 --
35 --
36+ | ObjectLiteral [(String, a)]
50− | ObjectLiteral [(String, a)] deriving (Show, Read, D.Data, D.Typeable, Functor)
37+ deriving (Show, Read, Functor)
src/Language/PureScript/CoreFn/Meta.hs+6−19
@@ -1,23 +1,8 @@
1−-----------------------------------------------------------------------------
1+-- |
2−--
3−-- Module : Language.PureScript.CoreFn.Meta
4−-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
5−-- License : MIT
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>, Gary Burgess <gary.burgess@gmail.com>
8−-- Stability : experimental
9−-- Portability :
10−--
11−-- | Metadata annotations for core functional representation
2+-- Metadata annotations for core functional representation
12--
3--
13−-----------------------------------------------------------------------------
14−
15−{-# LANGUAGE DeriveDataTypeable #-}
16−
17module Language.PureScript.CoreFn.Meta where
4module Language.PureScript.CoreFn.Meta where
18
5
19−import qualified Data.Data as D
20−
21import Language.PureScript.Names
6import Language.PureScript.Names
22
7
23-- |
8-- |
@@ -39,7 +24,8 @@ data Meta
39 -- |
24 -- |
40 -- The contained reference is for a foreign member
25 -- The contained reference is for a foreign member
41 --
26 --
27+ | IsForeign
42− | IsForeign deriving (Show, Read, D.Data, D.Typeable)
28+ deriving (Show, Read)
43
29
44-- |
30-- |
45-- Data constructor metadata
31-- Data constructor metadata
@@ -52,4 +38,5 @@ data ConstructorType
52 -- |
38 -- |
53 -- The constructor is for a type with multiple construcors
39 -- The constructor is for a type with multiple construcors
54 --
40 --
41+ | SumType
55− | SumType deriving (Show, Read, D.Data, D.Typeable)
42+ deriving (Show, Read)
src/Language/PureScript/Environment.hs+5−5
@@ -1,10 +1,8 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE OverloadedStrings #-}
1{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE TemplateHaskell #-}
2{-# LANGUAGE TemplateHaskell #-}
4
3
5module Language.PureScript.Environment where
4module Language.PureScript.Environment where
6
5
7−import Data.Data
8import Data.Maybe (fromMaybe)
6import Data.Maybe (fromMaybe)
9import Data.Aeson.TH
7import Data.Aeson.TH
10import qualified Data.Map as M
8import qualified Data.Map as M
@@ -84,7 +82,8 @@ data NameKind
84 -- |
82 -- |
85 -- A name for member introduced by foreign import
83 -- A name for member introduced by foreign import
86 --
84 --
85+ | External
87− | External deriving (Show, Read, Eq, Data, Typeable)
86+ deriving (Show, Read, Eq)
88
87
89-- |
88-- |
90-- The kinds of a type
89-- The kinds of a type
@@ -110,7 +109,7 @@ data TypeKind
110 -- A scoped type variable
109 -- A scoped type variable
111 --
110 --
112 | ScopedTypeVar
111 | ScopedTypeVar
113− deriving (Show, Read, Eq, Data, Typeable)
112+ deriving (Show, Read, Eq)
114
113
115-- |
114-- |
116-- The type ('data' or 'newtype') of a data type declaration
115-- The type ('data' or 'newtype') of a data type declaration
@@ -123,7 +122,8 @@ data DataDeclType
123 -- |
122 -- |
124 -- A newtype constructor
123 -- A newtype constructor
125 --
124 --
125+ | Newtype
126− | Newtype deriving (Show, Read, Eq, Ord, Data, Typeable)
126+ deriving (Show, Read, Eq, Ord)
127
127
128showDataDeclType :: DataDeclType -> String
128showDataDeclType :: DataDeclType -> String
129showDataDeclType Data = "data"
129showDataDeclType Data = "data"
src/Language/PureScript/Kinds.hs+2−17
@@ -1,18 +1,3 @@
1−-----------------------------------------------------------------------------
2−--
3−-- Module : Language.PureScript.Kinds
4−-- Copyright : (c) Phil Freeman 2013
5−-- License : MIT
6−--
7−-- Maintainer : Phil Freeman <paf31@cantab.net>
8−-- Stability : experimental
9−-- Portability :
10−--
11−-- |
12−--
13−-----------------------------------------------------------------------------
14−
15−{-# LANGUAGE DeriveDataTypeable #-}
16{-# LANGUAGE TemplateHaskell #-}
1{-# LANGUAGE TemplateHaskell #-}
17
2
18module Language.PureScript.Kinds where
3module Language.PureScript.Kinds where
@@ -20,7 +5,6 @@ module Language.PureScript.Kinds where
20import Prelude ()
5import Prelude ()
21import Prelude.Compat
6import Prelude.Compat
22
7
23−import Data.Data
24import qualified Data.Aeson.TH as A
8import qualified Data.Aeson.TH as A
25
9
26-- |
10-- |
@@ -46,7 +30,8 @@ data Kind
46 -- |
30 -- |
47 -- Function kinds
31 -- Function kinds
48 --
32 --
33+ | FunKind Kind Kind
49− | FunKind Kind Kind deriving (Show, Read, Eq, Ord, Data, Typeable)
34+ deriving (Show, Read, Eq, Ord)
50
35
51$(A.deriveJSON A.defaultOptions ''Kind)
36$(A.deriveJSON A.defaultOptions ''Kind)
52
37
src/Language/PureScript/Names.hs+7−6
@@ -1,4 +1,3 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE DeriveFunctor #-}
1{-# LANGUAGE DeriveFunctor #-}
3{-# LANGUAGE TemplateHaskell #-}
2{-# LANGUAGE TemplateHaskell #-}
4{-# LANGUAGE EmptyDataDecls #-}
3{-# LANGUAGE EmptyDataDecls #-}
@@ -13,7 +12,6 @@ import Control.Monad (liftM)
13import Control.Monad.Supply.Class
12import Control.Monad.Supply.Class
14
13
15import Data.List
14import Data.List
16−import Data.Data
17import Data.Aeson
15import Data.Aeson
18import Data.Aeson.TH
16import Data.Aeson.TH
19
17
@@ -32,7 +30,8 @@ data Ident
32 -- |
30 -- |
33 -- A generated name for an identifier
31 -- A generated name for an identifier
34 --
32 --
35− | GenIdent (Maybe String) Integer deriving (Show, Read, Eq, Ord, Data, Typeable)
33+ | GenIdent (Maybe String) Integer
34+ deriving (Show, Read, Eq, Ord)
36
35
37runIdent :: Ident -> String
36runIdent :: Ident -> String
38runIdent (Ident i) = i
37runIdent (Ident i) = i
@@ -54,7 +53,7 @@ freshIdent' = liftM (GenIdent Nothing) fresh
54-- Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
53-- Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
55--
54--
56newtype ProperName (a :: ProperNameType) = ProperName { runProperName :: String }
55newtype ProperName (a :: ProperNameType) = ProperName { runProperName :: String }
57− deriving (Show, Read, Eq, Ord, Data, Typeable)
56+ deriving (Show, Read, Eq, Ord)
58
57
59instance ToJSON (ProperName a) where
58instance ToJSON (ProperName a) where
60 toJSON = toJSON . runProperName
59 toJSON = toJSON . runProperName
@@ -78,7 +77,8 @@ coerceProperName = ProperName . runProperName
78-- |
77-- |
79-- Module names
78-- Module names
80--
79--
81−newtype ModuleName = ModuleName [ProperName 'Namespace] deriving (Show, Read, Eq, Ord, Data, Typeable)
80+newtype ModuleName = ModuleName [ProperName 'Namespace]
81+ deriving (Show, Read, Eq, Ord)
82
82
83runModuleName :: ModuleName -> String
83runModuleName :: ModuleName -> String
84runModuleName (ModuleName pns) = intercalate "." (runProperName `map` pns)
84runModuleName (ModuleName pns) = intercalate "." (runProperName `map` pns)
@@ -94,7 +94,8 @@ moduleNameFromString = ModuleName . splitProperNames
94-- |
94-- |
95-- A qualified name, i.e. a name with an optional module name
95-- A qualified name, i.e. a name with an optional module name
96--
96--
97−data Qualified a = Qualified (Maybe ModuleName) a deriving (Show, Read, Eq, Ord, Data, Typeable, Functor)
97+data Qualified a = Qualified (Maybe ModuleName) a
98+ deriving (Show, Read, Eq, Ord, Functor)
98
99
99showQualified :: (a -> String) -> Qualified a -> String
100showQualified :: (a -> String) -> Qualified a -> String
100showQualified f (Qualified Nothing a) = f a
101showQualified f (Qualified Nothing a) = f a
src/Language/PureScript/TypeClassDictionaries.hs+2−5
@@ -1,9 +1,5 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−
3module Language.PureScript.TypeClassDictionaries where
1module Language.PureScript.TypeClassDictionaries where
4
2
5−import Data.Data
6−
7import Language.PureScript.Names
3import Language.PureScript.Names
8import Language.PureScript.Types
4import Language.PureScript.Types
9
5
@@ -22,7 +18,8 @@ data TypeClassDictionaryInScope
22 , tcdInstanceTypes :: [Type]
18 , tcdInstanceTypes :: [Type]
23 -- | Type class dependencies which must be satisfied to construct this dictionary
19 -- | Type class dependencies which must be satisfied to construct this dictionary
24 , tcdDependencies :: Maybe [Constraint]
20 , tcdDependencies :: Maybe [Constraint]
21+ }
25− } deriving (Show, Read, Data, Typeable)
22+ deriving (Show, Read)
26
23
27-- |
24-- |
28-- A simplified representation of expressions which are used to represent type
25-- A simplified representation of expressions which are used to represent type
src/Language/PureScript/Types.hs+4−4
@@ -1,4 +1,3 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE TemplateHaskell #-}
2{-# LANGUAGE TemplateHaskell #-}
4
3
@@ -10,7 +9,6 @@ module Language.PureScript.Types where
10import Prelude ()
9import Prelude ()
11import Prelude.Compat
10import Prelude.Compat
12
11
13−import Data.Data
14import Data.List (nub)
12import Data.List (nub)
15import Data.Maybe (fromMaybe)
13import Data.Maybe (fromMaybe)
16import qualified Data.Aeson as A
14import qualified Data.Aeson as A
@@ -27,7 +25,8 @@ import Language.PureScript.AST.SourcePos
27-- |
25-- |
28-- An identifier for the scope of a skolem variable
26-- An identifier for the scope of a skolem variable
29--
27--
30−newtype SkolemScope = SkolemScope { runSkolemScope :: Int } deriving (Show, Read, Eq, Ord, Data, Typeable, A.ToJSON, A.FromJSON)
28+newtype SkolemScope = SkolemScope { runSkolemScope :: Int }
29+ deriving (Show, Read, Eq, Ord, A.ToJSON, A.FromJSON)
31
30
32-- |
31-- |
33-- The type of types
32-- The type of types
@@ -89,7 +88,8 @@ data Type
89 -- |
88 -- |
90 -- A placeholder used in pretty printing
89 -- A placeholder used in pretty printing
91 --
90 --
92− | PrettyPrintForAll [String] Type deriving (Show, Read,Eq, Ord, Data, Typeable)
91+ | PrettyPrintForAll [String] Type
92+ deriving (Show, Read, Eq, Ord)
93
93
94-- |
94-- |
95-- A typeclass constraint
95-- A typeclass constraint