Skip to content

Commit da69d79

Browse files
committed
Initial attempt at sublibraries but hpack doesn't have this.
1 parent cf5bc56 commit da69d79

File tree

5 files changed

+222
-199
lines changed

5 files changed

+222
-199
lines changed

cabal.project

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ packages:
1414
uom-plugin-examples
1515
uom-th
1616
build
17+
plugins-for-blobs.cabal
1718
tests: True
1819
write-ghc-environment-files: always

package.dhall

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let uom-quantity = ./uom-quantity/package-relative.dhall "uom-quantity/"
2+
3+
in { name = "plugins-for-blobs"
4+
, `library uom-quantity` =
5+
uom-quantity.library // { when = uom-quantity.when }
6+
}

plugins-for-blobs.cabal

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cabal-version: 1.12
2+
3+
-- This file has been generated from package.dhall by hpack version 0.34.6.
4+
--
5+
-- see: https://github.com/sol/hpack
6+
7+
name: plugins-for-blobs
8+
version: 0.0.0
9+
build-type: Simple

uom-quantity/package-relative.dhall

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
λ(src : Text)
2+
let defs = ./../defaults-uom.dhall
3+
4+
in let testopts = [ "-rtsopts", "-threaded", "-with-rtsopts=-N" ]
5+
6+
in defs
7+
{ name = "uom-quantity"
8+
, synopsis = "Units of measure as a GHC typechecker plugin"
9+
, description =
10+
''
11+
The @uom-plugin@ library adds support for units of measure to GHC
12+
using the new experimental facility for typechecker plugins, which
13+
is available in GHC 7.10 and later. See
14+
"Data.UnitsOfMeasure.Tutorial" for an introduction to the library.''
15+
, category = "Type System"
16+
, github = "adamgundry/uom-plugin"
17+
, stability = "experimental"
18+
, extra-source-files = defs.extra-source-files # [ "README.md" ]
19+
, library =
20+
{ source-dirs = [ "${src}src" ]
21+
, dependencies =
22+
defs.dependencies
23+
# [ "deepseq >=1.3 && <1.5"
24+
, "template-haskell >=2.9"
25+
, "containers >=0.5"
26+
, "ghc-corroborate"
27+
, "ghc-tcplugins-trace"
28+
, "units-parser >=0.1.1.4"
29+
]
30+
, exposed-modules =
31+
[ "Data.Theory.UoM"
32+
, "Data.UnitsOfMeasure.Read"
33+
, "Data.UnitsOfMeasure.Show"
34+
, "Data.UnitsOfMeasure.Singleton"
35+
, "Data.UnitsOfMeasure.Syntax"
36+
, "Data.UnitsOfMeasure.Unsafe.Find"
37+
, "Data.UnitsOfMeasure.Unsafe.Kind"
38+
, "Data.UnitsOfMeasure.Unsafe.NormalForm"
39+
, "Data.UnitsOfMeasure.Unsafe.Quantity"
40+
, "Data.UnitsOfMeasure.Unsafe.Unify"
41+
, "Data.UnitsOfMeasure.Unsafe.UnitDefs"
42+
, "Data.UnitsOfMeasure"
43+
, "Plugins.UoM.State"
44+
, "Plugins.UoM.Eq"
45+
, "Plugins.UoM.Eq.TcPlugin"
46+
, "Plugins.UoM.Unpack"
47+
, "Plugins.UoM.Unpack.TcPlugin"
48+
, "Plugins.UoM.UnpackEq"
49+
, "Internal.Unit.Type"
50+
]
51+
, other-modules = [] : List Text
52+
}
53+
, when =
54+
[ { condition = "impl(ghc >= 9.2) && impl(ghc < 9.4)"
55+
, source-dirs =
56+
[ "${src}src-ghc-9.0", "${src}src-StandaloneKindSignatures" ]
57+
, dependencies =
58+
[ { name = "ghc"
59+
, version = ">=9.2 && <9.4"
60+
, mixin = [] : List Text
61+
}
62+
]
63+
}
64+
, { condition = "impl(ghc >= 9.0) && impl(ghc < 9.2)"
65+
, source-dirs =
66+
[ "${src}src-ghc-9.0", "${src}src-StandaloneKindSignatures" ]
67+
, dependencies =
68+
[ { name = "ghc"
69+
, version = ">=9.0 && <9.2"
70+
, mixin = [] : List Text
71+
}
72+
]
73+
}
74+
, { condition = "impl(ghc >= 8.10.1) && impl(ghc < 9.0)"
75+
, source-dirs =
76+
[ "${src}src-ghc-8.10", "${src}src-StandaloneKindSignatures" ]
77+
, dependencies =
78+
[ { name = "ghc"
79+
, version = ">=8.10 && <8.12"
80+
, mixin = [] : List Text
81+
}
82+
]
83+
}
84+
, { condition = "impl(ghc >= 8.10.0) && impl(ghc < 8.10.1)"
85+
, source-dirs =
86+
[ "${src}src-ghc-8.10", "${src}src-NoStandaloneKindSignatures" ]
87+
, dependencies =
88+
[ { name = "ghc"
89+
, version = ">=8.10 && <8.12"
90+
, mixin = [] : List Text
91+
}
92+
]
93+
}
94+
, { condition = "impl(ghc >= 8.8.0) && impl(ghc < 8.10.0)"
95+
, source-dirs =
96+
[ "${src}src-ghc-8.8", "${src}src-NoStandaloneKindSignatures" ]
97+
, dependencies =
98+
[ { name = "ghc"
99+
, version = ">=8.8 && <8.10"
100+
, mixin =
101+
[ "hiding ()"
102+
, "(TcRnTypes as TcRnTypes)"
103+
, "(Type as Type)"
104+
, "(TcRnTypes as Constraint)"
105+
, "(Type as Predicate)"
106+
]
107+
}
108+
]
109+
}
110+
, { condition = "impl(ghc >= 8.6.0) && impl(ghc < 8.8.0)"
111+
, source-dirs =
112+
[ "${src}src-ghc-8.6", "${src}src-NoStandaloneKindSignatures" ]
113+
, dependencies =
114+
[ { name = "ghc"
115+
, version = ">=8.6 && <8.8"
116+
, mixin =
117+
[ "hiding ()"
118+
, "(TcRnTypes as TcRnTypes)"
119+
, "(Type as Type)"
120+
, "(TcRnTypes as Constraint)"
121+
, "(Type as Predicate)"
122+
]
123+
}
124+
]
125+
}
126+
, { condition = "impl(ghc >= 8.4.0) && impl(ghc < 8.6.0)"
127+
, source-dirs =
128+
[ "${src}src-ghc-8.4", "${src}src-NoStandaloneKindSignatures" ]
129+
, dependencies =
130+
[ { name = "ghc"
131+
, version = ">=8.4 && <8.6"
132+
, mixin =
133+
[ "hiding ()"
134+
, "(TcRnTypes as TcRnTypes)"
135+
, "(Type as Type)"
136+
, "(TcRnTypes as Constraint)"
137+
, "(Type as Predicate)"
138+
]
139+
}
140+
]
141+
}
142+
, { condition = "impl(ghc >= 8.2.0) && impl(ghc < 8.4.0)"
143+
, source-dirs =
144+
[ "${src}src-ghc-8.2", "${src}src-NoStandaloneKindSignatures" ]
145+
, dependencies =
146+
[ { name = "ghc"
147+
, version = ">=8.2 && <8.4"
148+
, mixin =
149+
[ "hiding ()"
150+
, "(TcRnTypes as TcRnTypes)"
151+
, "(Type as Type)"
152+
, "(TcRnTypes as Constraint)"
153+
, "(Type as Predicate)"
154+
]
155+
}
156+
]
157+
}
158+
, { condition = "impl(ghc >= 8.0.0) && impl(ghc < 8.2.0)"
159+
, source-dirs =
160+
[ "${src}src-ghc-8.0", "${src}src-NoStandaloneKindSignatures" ]
161+
, dependencies =
162+
[ { name = "ghc"
163+
, version = ">=8.0 && <8.2"
164+
, mixin =
165+
[ "hiding ()"
166+
, "(TcRnTypes as TcRnTypes)"
167+
, "(Type as Type)"
168+
, "(TcRnTypes as Constraint)"
169+
, "(Type as Predicate)"
170+
]
171+
}
172+
]
173+
}
174+
]
175+
, tests.doctest
176+
=
177+
{ dependencies =
178+
defs.dependencies
179+
# [ "deepseq >=1.3 && <1.5"
180+
, "template-haskell >=2.9"
181+
, "containers >=0.5"
182+
, "ghc-corroborate"
183+
, "ghc-tcplugins-trace"
184+
, "units-parser >=0.1"
185+
, "doctest"
186+
, "QuickCheck"
187+
]
188+
, ghc-options = [ "-rtsopts", "-threaded", "-with-rtsopts=-N" ]
189+
, main = "DocTest.hs"
190+
, source-dirs = [ "${src}src" ]
191+
, when =
192+
{ condition = "impl(ghc >= 8.10.1)"
193+
, `then` =
194+
{ source-dirs = "${src}test-suite-doctest-StandaloneKindSignatures"
195+
, other-modules = [] : List Text
196+
}
197+
, `else` =
198+
{ source-dirs =
199+
"${src}test-suite-doctest-NoStandaloneKindSignatures"
200+
, other-modules = [] : List Text
201+
}
202+
}
203+
}
204+
}

0 commit comments

Comments
 (0)