Improve assertions in `IntegrationTests2` `testConfigOptionComments`
[cabal.git] / Cabal-tree-diff / src / Data / TreeDiff / Instances / Cabal.hs
blob15fae62649e1a8a9038a28e8e350d48b2e91b6ae
1 {-# LANGUAGE CPP #-}
2 {-# OPTIONS_GHC -freduction-depth=0 #-}
3 {-# OPTIONS_GHC -fno-warn-orphans #-}
4 module Data.TreeDiff.Instances.Cabal () where
6 import Data.TreeDiff
8 import Data.TreeDiff.Instances.CabalLanguage ()
9 import Data.TreeDiff.Instances.CabalSPDX ()
10 import Data.TreeDiff.Instances.CabalVersion ()
12 -------------------------------------------------------------------------------
14 import Distribution.Backpack (OpenModule, OpenUnitId)
15 import Distribution.CabalSpecVersion (CabalSpecVersion)
16 import Distribution.Compiler (CompilerFlavor, CompilerId, PerCompilerFlavor)
17 import Distribution.InstalledPackageInfo (AbiDependency, ExposedModule, InstalledPackageInfo)
18 import Distribution.ModuleName (ModuleName)
19 import Distribution.PackageDescription
20 import Distribution.Simple.Compiler (DebugInfoLevel, OptimisationLevel, ProfDetailLevel)
21 import Distribution.Simple.Flag (Flag)
22 import Distribution.Simple.InstallDirs
23 import Distribution.Simple.InstallDirs.Internal
24 import Distribution.Simple.Setup (HaddockTarget, TestShowDetails)
25 import Distribution.System
26 import Distribution.Types.AbiHash (AbiHash)
27 import Distribution.Types.ComponentId (ComponentId)
28 import Distribution.Types.DumpBuildInfo (DumpBuildInfo)
29 import Distribution.Types.PackageVersionConstraint
30 import Distribution.Types.UnitId (DefUnitId, UnitId)
31 import Distribution.Utils.NubList (NubList)
32 import Distribution.Utils.Path (SymbolicPathX)
33 import Distribution.Utils.ShortText (ShortText, fromShortText)
34 import Distribution.Verbosity
35 import Distribution.Verbosity.Internal
37 import qualified Distribution.Compat.NonEmptySet as NES
39 -------------------------------------------------------------------------------
40 -- instances
41 -------------------------------------------------------------------------------
43 instance (Eq a, Show a) => ToExpr (Condition a) where toExpr = defaultExprViaShow
44 instance (Show a, ToExpr b, ToExpr c, Show b, Show c, Eq a, Eq c, Eq b) => ToExpr (CondTree a b c)
45 instance (Show a, ToExpr b, ToExpr c, Show b, Show c, Eq a, Eq c, Eq b) => ToExpr (CondBranch a b c)
46 instance (ToExpr a) => ToExpr (NubList a)
47 instance (ToExpr a) => ToExpr (Flag a)
48 instance ToExpr a => ToExpr (NES.NonEmptySet a) where
49 toExpr xs = App "NonEmptySet.fromNonEmpty" [toExpr $ NES.toNonEmpty xs]
51 instance ToExpr a => ToExpr (PerCompilerFlavor a)
53 instance ToExpr Dependency where
54 toExpr d@(Dependency pn vr cs)
55 | cs == mainLibSet = App "Dependency" [toExpr pn, toExpr vr, App "mainLibSet" []]
56 | otherwise = genericToExpr d
58 instance ToExpr (SymbolicPathX allowAbs from to)
60 instance ToExpr a => ToExpr (InstallDirs a)
62 instance ToExpr AbiDependency
63 instance ToExpr AbiHash
64 instance ToExpr Arch
65 instance ToExpr Benchmark
66 instance ToExpr BenchmarkInterface
67 instance ToExpr BenchmarkType
68 instance ToExpr BuildInfo
69 instance ToExpr BuildType
70 instance ToExpr CabalSpecVersion
71 instance ToExpr CompilerFlavor
72 instance ToExpr CompilerId
73 instance ToExpr ComponentId
74 instance ToExpr DebugInfoLevel
75 instance ToExpr DefUnitId
76 instance ToExpr DumpBuildInfo
77 instance ToExpr ExeDependency
78 instance ToExpr Executable
79 instance ToExpr ExecutableScope
80 instance ToExpr ExposedModule
81 instance ToExpr FlagAssignment
82 instance ToExpr FlagName
83 instance ToExpr ForeignLib
84 instance ToExpr ForeignLibOption
85 instance ToExpr ForeignLibType
86 instance ToExpr GenericPackageDescription
87 instance ToExpr HaddockTarget
88 instance ToExpr IncludeRenaming
89 instance ToExpr InstalledPackageInfo
90 instance ToExpr KnownRepoType
91 instance ToExpr LegacyExeDependency
92 instance ToExpr LibVersionInfo
93 instance ToExpr Library
94 instance ToExpr LibraryName
95 instance ToExpr LibraryVisibility
96 instance ToExpr Mixin
97 instance ToExpr ModuleName
98 instance ToExpr ModuleReexport
99 instance ToExpr ModuleRenaming
100 instance ToExpr OS
101 instance ToExpr OpenModule
102 instance ToExpr OpenUnitId
103 instance ToExpr OptimisationLevel
104 instance ToExpr PackageDescription
105 instance ToExpr PackageFlag
106 instance ToExpr PackageIdentifier
107 instance ToExpr PackageName
108 instance ToExpr PackageVersionConstraint
109 instance ToExpr PathComponent
110 instance ToExpr PathTemplate
111 instance ToExpr PathTemplateVariable
112 instance ToExpr PkgconfigDependency
113 instance ToExpr PkgconfigName
114 instance ToExpr PkgconfigVersion
115 instance ToExpr PkgconfigVersionRange
116 instance ToExpr ProfDetailLevel
117 instance ToExpr RepoKind
118 instance ToExpr RepoType
119 instance ToExpr SetupBuildInfo
120 instance ToExpr SourceRepo
121 instance ToExpr TestShowDetails
122 instance ToExpr TestSuite
123 instance ToExpr TestSuiteInterface
124 instance ToExpr TestType
125 instance ToExpr UnitId
126 instance ToExpr UnqualComponentName
127 instance ToExpr Verbosity
128 instance ToExpr VerbosityFlag
129 instance ToExpr VerbosityLevel
131 instance ToExpr ShortText where toExpr = toExpr . fromShortText