on develop help sign in
Merge pull request #79 from hamishmack/develop

Add use-template-haskell flag

commit7c3efd458060fddc1f31625a6f3fe98f8b0f8508 authorRyan Trinkle <ryan.trinkle@gmail.com> dateSun 22 Jan 2017, 22:18 (10 years ago) parent4eb436e84c126c
2 files changed+22−6
reflex.cabal+19−6 src/Reflex.hs+3
reflex.cabal+19−6
@@ -23,6 +23,11 @@ flag use-reflex-optimizer
2323 default: False
2424 manual: True
2525
26+flag use-template-haskell
27+ description: Use template haskell to generate lenses
28+ default: True
29+ manual: True
30+
2631library
2732 hs-source-dirs: src
2833 build-depends:
@@ -32,10 +37,7 @@ library
3237 containers == 0.5.*,
3338 data-default >= 0.5 && < 0.8,
3439 dependent-map >= 0.2.4 && < 0.3,
35− dependent-sum >= 0.3 && < 0.5,
3640 exception-transformers == 0.4.*,
37− haskell-src-exts >= 1.16 && < 1.18,
38− haskell-src-meta == 0.6.*,
3941 lens >= 4.7 && < 5,
4042 monad-control >= 1.0.1 && < 1.1,
4143 mtl >= 2.1 && < 2.3,
@@ -47,7 +49,6 @@ library
4749 semigroups >= 0.16 && < 0.19,
4850 stm == 2.4.*,
4951 syb >= 0.5 && < 0.7,
50− template-haskell >= 2.9 && < 2.12,
5152 these >= 0.4 && < 0.8,
5253 transformers >= 0.2,
5354 transformers-compat >= 0.3
@@ -59,7 +60,6 @@ library
5960 Reflex.Class,
6061 Reflex.EventWriter,
6162 Reflex.Dynamic,
62− Reflex.Dynamic.TH,
6363 Reflex.Dynamic.Uniq,
6464 Reflex.DynamicWriter,
6565 Reflex.FunctorMaybe,
@@ -76,7 +76,6 @@ library
7676 Reflex.Spider,
7777 Reflex.Spider.Internal
7878
79− other-extensions: TemplateHaskell
8079 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
8180 ghc-prof-options: -auto-all
8281
@@ -90,6 +89,20 @@ library
9089 build-depends: ghc
9190 exposed-modules: Reflex.Optimizer
9291
92+ if flag(use-template-haskell)
93+ cpp-options: -DUSE_TEMPLATE_HASKELL
94+ build-depends:
95+ dependent-sum >= 0.3 && < 0.5,
96+ haskell-src-exts >= 1.16 && < 1.18,
97+ haskell-src-meta == 0.6.*,
98+ template-haskell >= 2.9 && < 2.12
99+ exposed-modules:
100+ Reflex.Dynamic.TH
101+ other-extensions: TemplateHaskell
102+ else
103+ build-depends:
104+ dependent-sum == 0.4.*
105+
93106test-suite semantics
94107 type: exitcode-stdio-1.0
95108 main-is: semantics.hs
src/Reflex.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12-- | This module exports all of the commonly-used functionality of Reflex; if
23-- you are just getting started with Reflex, this is probably what you want.
34module Reflex
@@ -7,7 +8,9 @@ module Reflex
78import Reflex.Class as X
89import Reflex.EventWriter as X
910import Reflex.Dynamic as X
11+#ifdef USE_TEMPLATE_HASKELL
1012import Reflex.Dynamic.TH as X
13+#endif
1114import Reflex.Dynamic.Uniq as X
1215import Reflex.DynamicWriter as X
1316import Reflex.PerformEvent.Base as X