1module Distribution.Types.InstalledPackageInfo.Lens (
2    InstalledPackageInfo,
3    module Distribution.Types.InstalledPackageInfo.Lens
4    ) where
5
6import Distribution.Compat.Lens
7import Distribution.Compat.Prelude
8import Prelude ()
9
10import Distribution.Backpack                   (OpenModule)
11import Distribution.License                    (License)
12import Distribution.ModuleName                 (ModuleName)
13import Distribution.Package                    (AbiHash, ComponentId, PackageIdentifier, UnitId)
14import Distribution.Types.InstalledPackageInfo (AbiDependency, ExposedModule, InstalledPackageInfo)
15import Distribution.Types.LibraryName          (LibraryName)
16import Distribution.Types.LibraryVisibility    (LibraryVisibility)
17
18import qualified Distribution.SPDX                       as SPDX
19import qualified Distribution.Types.InstalledPackageInfo as T
20
21sourcePackageId :: Lens' InstalledPackageInfo PackageIdentifier
22sourcePackageId f s = fmap (\x -> s { T.sourcePackageId = x }) (f (T.sourcePackageId s))
23{-# INLINE sourcePackageId #-}
24
25installedUnitId :: Lens' InstalledPackageInfo UnitId
26installedUnitId f s = fmap (\x -> s { T.installedUnitId = x }) (f (T.installedUnitId s))
27{-# INLINE installedUnitId #-}
28
29installedComponentId_ :: Lens' InstalledPackageInfo ComponentId
30installedComponentId_ f s = fmap (\x -> s { T.installedComponentId_ = x }) (f (T.installedComponentId_ s))
31{-# INLINE installedComponentId_ #-}
32
33instantiatedWith :: Lens' InstalledPackageInfo [(ModuleName,OpenModule)]
34instantiatedWith f s = fmap (\x -> s { T.instantiatedWith = x }) (f (T.instantiatedWith s))
35{-# INLINE instantiatedWith #-}
36
37sourceLibName :: Lens' InstalledPackageInfo LibraryName
38sourceLibName f s = fmap (\x -> s { T.sourceLibName = x }) (f (T.sourceLibName s))
39{-# INLINE sourceLibName #-}
40
41compatPackageKey :: Lens' InstalledPackageInfo String
42compatPackageKey f s = fmap (\x -> s { T.compatPackageKey = x }) (f (T.compatPackageKey s))
43{-# INLINE compatPackageKey #-}
44
45license :: Lens' InstalledPackageInfo (Either SPDX.License License)
46license f s = fmap (\x -> s { T.license = x }) (f (T.license s))
47{-# INLINE license #-}
48
49copyright :: Lens' InstalledPackageInfo String
50copyright f s = fmap (\x -> s { T.copyright = x }) (f (T.copyright s))
51{-# INLINE copyright #-}
52
53maintainer :: Lens' InstalledPackageInfo String
54maintainer f s = fmap (\x -> s { T.maintainer = x }) (f (T.maintainer s))
55{-# INLINE maintainer #-}
56
57author :: Lens' InstalledPackageInfo String
58author f s = fmap (\x -> s { T.author = x }) (f (T.author s))
59{-# INLINE author #-}
60
61stability :: Lens' InstalledPackageInfo String
62stability f s = fmap (\x -> s { T.stability = x }) (f (T.stability s))
63{-# INLINE stability #-}
64
65homepage :: Lens' InstalledPackageInfo String
66homepage f s = fmap (\x -> s { T.homepage = x }) (f (T.homepage s))
67{-# INLINE homepage #-}
68
69pkgUrl :: Lens' InstalledPackageInfo String
70pkgUrl f s = fmap (\x -> s { T.pkgUrl = x }) (f (T.pkgUrl s))
71{-# INLINE pkgUrl #-}
72
73synopsis :: Lens' InstalledPackageInfo String
74synopsis f s = fmap (\x -> s { T.synopsis = x }) (f (T.synopsis s))
75{-# INLINE synopsis #-}
76
77description :: Lens' InstalledPackageInfo String
78description f s = fmap (\x -> s { T.description = x }) (f (T.description s))
79{-# INLINE description #-}
80
81category :: Lens' InstalledPackageInfo String
82category f s = fmap (\x -> s { T.category = x }) (f (T.category s))
83{-# INLINE category #-}
84
85abiHash :: Lens' InstalledPackageInfo AbiHash
86abiHash f s = fmap (\x -> s { T.abiHash = x }) (f (T.abiHash s))
87{-# INLINE abiHash #-}
88
89indefinite :: Lens' InstalledPackageInfo Bool
90indefinite f s = fmap (\x -> s { T.indefinite = x }) (f (T.indefinite s))
91{-# INLINE indefinite #-}
92
93exposed :: Lens' InstalledPackageInfo Bool
94exposed f s = fmap (\x -> s { T.exposed = x }) (f (T.exposed s))
95{-# INLINE exposed #-}
96
97exposedModules :: Lens' InstalledPackageInfo [ExposedModule]
98exposedModules f s = fmap (\x -> s { T.exposedModules = x }) (f (T.exposedModules s))
99{-# INLINE exposedModules #-}
100
101hiddenModules :: Lens' InstalledPackageInfo [ModuleName]
102hiddenModules f s = fmap (\x -> s { T.hiddenModules = x }) (f (T.hiddenModules s))
103{-# INLINE hiddenModules #-}
104
105trusted :: Lens' InstalledPackageInfo Bool
106trusted f s = fmap (\x -> s { T.trusted = x }) (f (T.trusted s))
107{-# INLINE trusted #-}
108
109importDirs :: Lens' InstalledPackageInfo [FilePath]
110importDirs f s = fmap (\x -> s { T.importDirs = x }) (f (T.importDirs s))
111{-# INLINE importDirs #-}
112
113libraryDirs :: Lens' InstalledPackageInfo [FilePath]
114libraryDirs f s = fmap (\x -> s { T.libraryDirs = x }) (f (T.libraryDirs s))
115{-# INLINE libraryDirs #-}
116
117libraryDynDirs :: Lens' InstalledPackageInfo [FilePath]
118libraryDynDirs f s = fmap (\x -> s { T.libraryDynDirs = x }) (f (T.libraryDynDirs s))
119{-# INLINE libraryDynDirs #-}
120
121dataDir :: Lens' InstalledPackageInfo FilePath
122dataDir f s = fmap (\x -> s { T.dataDir = x }) (f (T.dataDir s))
123{-# INLINE dataDir #-}
124
125hsLibraries :: Lens' InstalledPackageInfo [String]
126hsLibraries f s = fmap (\x -> s { T.hsLibraries = x }) (f (T.hsLibraries s))
127{-# INLINE hsLibraries #-}
128
129extraLibraries :: Lens' InstalledPackageInfo [String]
130extraLibraries f s = fmap (\x -> s { T.extraLibraries = x }) (f (T.extraLibraries s))
131{-# INLINE extraLibraries #-}
132
133extraGHCiLibraries :: Lens' InstalledPackageInfo [String]
134extraGHCiLibraries f s = fmap (\x -> s { T.extraGHCiLibraries = x }) (f (T.extraGHCiLibraries s))
135{-# INLINE extraGHCiLibraries #-}
136
137includeDirs :: Lens' InstalledPackageInfo [FilePath]
138includeDirs f s = fmap (\x -> s { T.includeDirs = x }) (f (T.includeDirs s))
139{-# INLINE includeDirs #-}
140
141includes :: Lens' InstalledPackageInfo [String]
142includes f s = fmap (\x -> s { T.includes = x }) (f (T.includes s))
143{-# INLINE includes #-}
144
145depends :: Lens' InstalledPackageInfo [UnitId]
146depends f s = fmap (\x -> s { T.depends = x }) (f (T.depends s))
147{-# INLINE depends #-}
148
149abiDepends :: Lens' InstalledPackageInfo [AbiDependency]
150abiDepends f s = fmap (\x -> s { T.abiDepends = x }) (f (T.abiDepends s))
151{-# INLINE abiDepends #-}
152
153ccOptions :: Lens' InstalledPackageInfo [String]
154ccOptions f s = fmap (\x -> s { T.ccOptions = x }) (f (T.ccOptions s))
155{-# INLINE ccOptions #-}
156
157cxxOptions :: Lens' InstalledPackageInfo [String]
158cxxOptions f s = fmap (\x -> s { T.cxxOptions = x }) (f (T.cxxOptions s))
159{-# INLINE cxxOptions #-}
160
161ldOptions :: Lens' InstalledPackageInfo [String]
162ldOptions f s = fmap (\x -> s { T.ldOptions = x }) (f (T.ldOptions s))
163{-# INLINE ldOptions #-}
164
165frameworkDirs :: Lens' InstalledPackageInfo [FilePath]
166frameworkDirs f s = fmap (\x -> s { T.frameworkDirs = x }) (f (T.frameworkDirs s))
167{-# INLINE frameworkDirs #-}
168
169frameworks :: Lens' InstalledPackageInfo [String]
170frameworks f s = fmap (\x -> s { T.frameworks = x }) (f (T.frameworks s))
171{-# INLINE frameworks #-}
172
173haddockInterfaces :: Lens' InstalledPackageInfo [FilePath]
174haddockInterfaces f s = fmap (\x -> s { T.haddockInterfaces = x }) (f (T.haddockInterfaces s))
175{-# INLINE haddockInterfaces #-}
176
177haddockHTMLs :: Lens' InstalledPackageInfo [FilePath]
178haddockHTMLs f s = fmap (\x -> s { T.haddockHTMLs = x }) (f (T.haddockHTMLs s))
179{-# INLINE haddockHTMLs #-}
180
181pkgRoot :: Lens' InstalledPackageInfo (Maybe FilePath)
182pkgRoot f s = fmap (\x -> s { T.pkgRoot = x }) (f (T.pkgRoot s))
183{-# INLINE pkgRoot #-}
184
185libVisibility :: Lens' InstalledPackageInfo LibraryVisibility
186libVisibility f s = fmap (\x -> s { T.libVisibility = x }) (f (T.libVisibility s))
187{-# INLINE libVisibility #-}
188
189