@@ -22,3 +22,198 @@ deriving instance NFData PCPath.ProjectConfigPath
22
22
instance NFData PC. ProjectConfig where
23
23
rnf ! _ = ()
24
24
25
+ -- {-# OPTIONS_GHC -Wno-orphans #-}
26
+ -- {-# LANGUAGE FlexibleInstances #-}
27
+ -- {-# LANGUAGE RecordWildCards #-}
28
+
29
+ -- module Ide.Plugin.CabalProject.Orphans () where
30
+
31
+ -- import Control.DeepSeq ( NFData, rnf )
32
+ -- import Distribution.Compat.Prelude ( genericRnf )
33
+ -- import Distribution.Verbosity (Verbosity)
34
+ -- import Distribution.Verbosity.Internal (VerbosityLevel(..), VerbosityFlag(..))
35
+ -- import Ide.Plugin.Cabal.Orphans ()
36
+
37
+ -- import Distribution.Client.ProjectConfig.Types
38
+ -- ( BuildTimeSettings(..) )
39
+ -- import Distribution.Simple.InstallDirs.Internal
40
+ -- ( PathComponent(..), PathTemplateVariable(..)
41
+ -- )
42
+ -- import Distribution.Simple.InstallDirs
43
+ -- ( PathTemplate(..) )
44
+ -- import Control.DeepSeq ( NFData(rnf) )
45
+ -- import Distribution.Client.BuildReports.Types (ReportLevel)
46
+
47
+ -- import Distribution.Client.Types.Repo (RemoteRepo, LocalRepo)
48
+
49
+ -- -- PathTemplate
50
+ -- instance NFData PathTemplate where
51
+ -- rnf = genericRnf
52
+
53
+ -- instance NFData PathComponent where
54
+ -- rnf = genericRnf
55
+
56
+ -- instance NFData PathTemplateVariable where
57
+ -- rnf = genericRnf
58
+
59
+ -- -- Verbosity
60
+ -- instance NFData Verbosity where
61
+ -- rnf = genericRnf
62
+
63
+ -- -- instance NFData VerbosityLevel where
64
+ -- -- rnf = genericRnf
65
+
66
+ -- -- instance NFData VerbosityFlag where
67
+ -- -- rnf = genericRnf
68
+
69
+ -- -- ReportLevel
70
+ -- instance NFData ReportLevel where
71
+ -- rnf = genericRnf
72
+
73
+ -- -- RemoteRepo
74
+ -- instance NFData RemoteRepo where
75
+ -- rnf = genericRnf
76
+
77
+ -- instance NFData LocalRepo where
78
+ -- rnf = genericRnf
79
+
80
+ -- instance NFData BuildTimeSettings where
81
+ -- rnf bts =
82
+ -- rnf (buildSettingDryRun bts)
83
+ -- `seq` rnf (buildSettingOnlyDeps bts)
84
+ -- `seq` rnf (buildSettingOnlyDownload bts)
85
+ -- `seq` rnf (buildSettingSummaryFile bts)
86
+ -- `seq` ()
87
+ -- `seq` rnf (buildSettingLogVerbosity bts)
88
+ -- `seq` rnf (buildSettingBuildReports bts)
89
+ -- `seq` rnf (buildSettingReportPlanningFailure bts)
90
+ -- `seq` rnf (buildSettingSymlinkBinDir bts)
91
+ -- `seq` rnf (buildSettingNumJobs bts)
92
+ -- `seq` rnf (buildSettingKeepGoing bts)
93
+ -- `seq` rnf (buildSettingOfflineMode bts)
94
+ -- `seq` rnf (buildSettingKeepTempFiles bts)
95
+ -- `seq` rnf (buildSettingRemoteRepos bts)
96
+ -- `seq` rnf (buildSettingLocalNoIndexRepos bts)
97
+ -- `seq` rnf (buildSettingCacheDir bts)
98
+ -- `seq` rnf (buildSettingHttpTransport bts)
99
+ -- `seq` rnf (buildSettingIgnoreExpiry bts)
100
+ -- `seq` rnf (buildSettingProgPathExtra bts)
101
+ -- `seq` rnf (buildSettingHaddockOpen bts)
102
+ -- `seq` ()
103
+ -- {-# OPTIONS_GHC -Wno-orphans #-}
104
+ -- module Ide.Plugin.CabalProject.Orphans () where
105
+
106
+ -- import Control.DeepSeq ( NFData, rnf)
107
+ -- import Distribution.Compat.Prelude (genericRnf)
108
+ -- import Ide.Plugin.Cabal.Orphans ()
109
+ -- import Distribution.Client.ProjectConfig.Types (BuildTimeSettings(..))
110
+ -- import GHC.Generics ( Generic )
111
+ -- import Control.DeepSeq ( NFData(rnf) )
112
+ -- import Distribution.Simple.InstallDirs ( PathTemplate )
113
+ -- import Distribution.Verbosity ( Verbosity )
114
+ -- import Distribution.Client.BuildReports.Types ( ReportLevel )
115
+ -- import Distribution.Types.ParStrat ( ParStratInstall )
116
+ -- import Distribution.Client.Types.Repo ( RemoteRepo, LocalRepo )
117
+
118
+ -- -- 1) Orphan NFData instances for all the “missing” imported types.
119
+ -- instance NFData PathTemplate where rnf = genericRnf
120
+ -- instance NFData Verbosity where rnf = genericRnf
121
+ -- instance NFData ReportLevel where rnf = genericRnf
122
+ -- instance NFData ParStratInstall where rnf = genericRnf
123
+ -- instance NFData RemoteRepo where rnf = genericRnf
124
+ -- instance NFData LocalRepo where rnf = genericRnf
125
+
126
+ -- instance NFData BuildTimeSettings where
127
+ -- rnf bts =
128
+ -- rnf (buildSettingDryRun bts)
129
+ -- `seq` rnf (buildSettingOnlyDeps bts)
130
+ -- `seq` rnf (buildSettingOnlyDownload bts)
131
+ -- `seq` rnf (buildSettingSummaryFile bts)
132
+ -- `seq` ()
133
+ -- `seq` rnf (buildSettingLogVerbosity bts)
134
+ -- `seq` rnf (buildSettingBuildReports bts)
135
+ -- `seq` rnf (buildSettingReportPlanningFailure bts)
136
+ -- `seq` rnf (buildSettingSymlinkBinDir bts)
137
+ -- `seq` rnf (buildSettingNumJobs bts)
138
+ -- `seq` rnf (buildSettingKeepGoing bts)
139
+ -- `seq` rnf (buildSettingOfflineMode bts)
140
+ -- `seq` rnf (buildSettingKeepTempFiles bts)
141
+ -- `seq` rnf (buildSettingRemoteRepos bts)
142
+ -- `seq` rnf (buildSettingLocalNoIndexRepos bts)
143
+ -- `seq` rnf (buildSettingCacheDir bts)
144
+ -- `seq` rnf (buildSettingHttpTransport bts)
145
+ -- `seq` rnf (buildSettingIgnoreExpiry bts)
146
+ -- `seq` rnf (buildSettingProgPathExtra bts)
147
+ -- `seq` rnf (buildSettingHaddockOpen bts)
148
+ -- `seq` ()
149
+
150
+
151
+ -- import Control.DeepSeq (NFData(rnf))
152
+ -- import qualified Data.Map as Map
153
+ -- import qualified Data.Set as Set
154
+ -- import Ide.Plugin.Cabal.Orphans ()
155
+
156
+
157
+ -- import Distribution.Client.ProjectConfig.Types
158
+ -- ( ProjectConfig(..)
159
+ -- , ProjectConfigBuildOnly
160
+ -- , ProjectConfigShared
161
+ -- , ProjectConfigProvenance
162
+ -- , PackageConfig
163
+ -- , MapMappend(getMapMappend)
164
+ -- )
165
+ -- import Distribution.Client.Types.SourceRepo
166
+ -- ( SourceRepoList )
167
+ -- import Distribution.Types.PackageVersionConstraint
168
+ -- ( PackageVersionConstraint )
169
+ -- import Distribution.Types.PackageName
170
+ -- ( PackageName )
171
+
172
+ -- -- | The only “deep” NFData: we pattern‐match on all ten fields and
173
+ -- -- rnf them. For the Set we convert to a list so we don’t need
174
+ -- -- a Set‐instance; for the MapMappend we unwrap to a list of pairs.
175
+ -- instance NFData ProjectConfig where
176
+ -- rnf (ProjectConfig
177
+ -- pkgs
178
+ -- pkgsOpt
179
+ -- pkgsRepo
180
+ -- pkgsNamed
181
+ -- buildOnly
182
+ -- shared
183
+ -- prov
184
+ -- allPkgs
185
+ -- localPkgs
186
+ -- specificM) =
187
+ -- rnf pkgs
188
+ -- `seq` rnf pkgsOpt
189
+ -- `seq` rnf pkgsRepo
190
+ -- `seq` rnf pkgsNamed
191
+ -- `seq` rnf buildOnly
192
+ -- `seq` rnf shared
193
+ -- `seq` rnf (Set.toList prov)
194
+ -- `seq` rnf allPkgs
195
+ -- `seq` rnf localPkgs
196
+ -- `seq` rnf (Map.toList (getMapMappend specificM))
197
+
198
+ -- -- Trivial NFData instances for all of the immediate field types
199
+ -- -- so that the above rnf calls will compile.
200
+
201
+ -- instance NFData SourceRepoList where
202
+ -- rnf _ = ()
203
+
204
+ -- instance NFData ProjectConfigBuildOnly where
205
+ -- rnf _ = ()
206
+
207
+ -- instance NFData ProjectConfigShared where
208
+ -- rnf _ = ()
209
+
210
+ -- instance NFData ProjectConfigProvenance where
211
+ -- rnf _ = ()
212
+
213
+ -- instance NFData PackageConfig where
214
+ -- rnf _ = ()
215
+
216
+
217
+ ------------------------------------------------- OLD
218
+
219
+
0 commit comments