/
hsreduce.dhall
176 lines (166 loc) · 6.16 KB
/
hsreduce.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
let Prelude =
https://prelude.dhall-lang.org/v19.0.0/package.dhall
let prelude =
https://raw.githubusercontent.com/dhall-lang/dhall-to-cabal/1.3.4.0/dhall/prelude.dhall
let types =
https://raw.githubusercontent.com/dhall-lang/dhall-to-cabal/1.3.4.0/dhall/types.dhall
let defaultExtensions =
[ types.Extension.DataKinds True
, types.Extension.DeriveGeneric True
, types.Extension.FlexibleContexts True
, types.Extension.FlexibleInstances True
, types.Extension.GeneralizedNewtypeDeriving True
, types.Extension.LambdaCase True
, types.Extension.MultiParamTypeClasses True
, types.Extension.OverloadedStrings True
, types.Extension.PatternSynonyms True
, types.Extension.QuasiQuotes True
, types.Extension.Rank2Types True
, types.Extension.RecordWildCards True
, types.Extension.ScopedTypeVariables True
, types.Extension.TemplateHaskell True
, types.Extension.TupleSections True
, types.Extension.TypeFamilies True
, types.Extension.TypeOperators True
, types.Extension.UndecidableInstances True
, types.Extension.ViewPatterns True
, types.Extension.TypeApplications True
]
let commonStuff =
{ default-extensions = defaultExtensions
, default-language = Some types.Language.Haskell2010
}
let makeBuildDepend = \(name : Text) -> { bounds = prelude.anyVersion, package = name }
let buildDepends =
Prelude.List.map Text types.Dependency makeBuildDepend
[ "base"
, "HUnit"
, "Cabal"
, "MonadRandom"
, "aeson"
, "bytestring"
, "cassava"
, "unordered-containers"
, "containers"
, "edit-distance"
, "ghc"
, "ghc-boot-th"
, "ghc-exactprint"
, "ghc-paths"
, "hashable"
, "hie-bios"
, "katip"
, "lifted-async"
, "Diff"
, "lifted-base"
, "megaparsec"
, "microlens-platform"
, "monad-control"
, "mtl"
, "optparse-generic"
, "path"
, "path-io"
, "process"
, "regex"
, "split"
, "stm-lifted"
, "syb"
, "text"
, "time"
, "uniplate"
, "word8"
, "transformers-base"
]
let prependReducePassesPrefix = \(prefix : Text) -> "Reduce.Passes." ++ prefix
let passes =
Prelude.List.map Text Text prependReducePassesPrefix
[ "Expr"
, "Types"
, "Pat"
, "Decls"
, "TypeFamilies"
, "Stubbing"
, "DataTypes"
, "Typeclasses"
, "Names"
, "Functions"
, "Imports"
, "Exports"
, "Pragmas"
, "Parameters"
, "TemplateHaskell"
]
in prelude.defaults.Package
// { name = "hsreduce"
, version = prelude.v "0.1.0.0"
, build-type = Some types.BuildType.Simple
, cabal-version = prelude.v "2.4"
, executables =
[ { executable =
\(config : types.Config)
-> prelude.defaults.Executable
// commonStuff
// { main-is = "Main.hs"
, build-depends = buildDepends # [{ bounds = prelude.anyVersion , package = "lib-hsreduce" }]
, compiler-options =
prelude.defaults.CompilerOptions
// { GHC =
[ "-Wall"
, "-threaded"
, "-rtsopts"
, "-with-rtsopts=-T"
, "-Wno-missing-methods"
, "-Wno-orphans"
] : List Text
}
, hs-source-dirs = [ "src" ]
}
, name = "hsreduce"
}
]
, sub-libraries =
[ { library =
\(config : types.Config)
->
prelude.defaults.Library
// commonStuff
// { build-depends = buildDepends
, compiler-options = prelude.defaults.CompilerOptions // { GHC = [ "-Wall" ] : List Text }
, hs-source-dirs = [ "src" ]
, other-modules = [ "Parser.Parser" ]
, exposed-modules =
passes #
[ "Merge.HsAllInOne"
, "Reduce.Driver"
, "Reduce.Passes"
, "Util.Util"
, "Util.Types"
]
}
, name = "lib-hsreduce"
}
]
, test-suites =
[ { name = "test-hsreduce"
, test-suite =
\(config : types.Config)
-> prelude.defaults.TestSuite
// commonStuff
// { type = types.TestType.exitcode-stdio { main-is = "Test.hs" }
, build-depends =
buildDepends
# Prelude.List.map Text types.Dependency makeBuildDepend [ "lib-hsreduce", "hspec" ]
, compiler-options = prelude.defaults.CompilerOptions // { GHC = [ "-Wall" ] : List Text }
, hs-source-dirs = [ "src", "test" ]
}
}
]
, license =
types.License.SPDX
( prelude.SPDX.license
types.LicenseId.BSD_3_Clause
(None types.LicenseExceptionId)
)
, extra-source-files = [ "CHANGELOG.md" ]
, license-files = [ "LICENSE" ]
}