on develop help sign in
Add use-template-haskell flag
84c126cHamish Mackenzie
reflex.cabal+19−6
@@ -23,6 +23,11 @@ flag use-reflex-optimizer
23 default: False
23 default: False
24 manual: True
24 manual: True
25
25
26+flag use-template-haskell
27+ description: Use template haskell to generate lenses
28+ default: True
29+ manual: True
30+
26library
31library
27 hs-source-dirs: src
32 hs-source-dirs: src
28 build-depends:
33 build-depends:
@@ -32,10 +37,7 @@ library
32 containers == 0.5.*,
37 containers == 0.5.*,
33 data-default >= 0.5 && < 0.8,
38 data-default >= 0.5 && < 0.8,
34 dependent-map >= 0.2.4 && < 0.3,
39 dependent-map >= 0.2.4 && < 0.3,
35− dependent-sum >= 0.3 && < 0.5,
36 exception-transformers == 0.4.*,
40 exception-transformers == 0.4.*,
37− haskell-src-exts >= 1.16 && < 1.18,
38− haskell-src-meta == 0.6.*,
39 lens >= 4.7 && < 5,
41 lens >= 4.7 && < 5,
40 monad-control >= 1.0.1 && < 1.1,
42 monad-control >= 1.0.1 && < 1.1,
41 mtl >= 2.1 && < 2.3,
43 mtl >= 2.1 && < 2.3,
@@ -47,7 +49,6 @@ library
47 semigroups >= 0.16 && < 0.19,
49 semigroups >= 0.16 && < 0.19,
48 stm == 2.4.*,
50 stm == 2.4.*,
49 syb >= 0.5 && < 0.7,
51 syb >= 0.5 && < 0.7,
50− template-haskell >= 2.9 && < 2.12,
51 these >= 0.4 && < 0.8,
52 these >= 0.4 && < 0.8,
52 transformers >= 0.2,
53 transformers >= 0.2,
53 transformers-compat >= 0.3
54 transformers-compat >= 0.3
@@ -59,7 +60,6 @@ library
59 Reflex.Class,
60 Reflex.Class,
60 Reflex.EventWriter,
61 Reflex.EventWriter,
61 Reflex.Dynamic,
62 Reflex.Dynamic,
62− Reflex.Dynamic.TH,
63 Reflex.Dynamic.Uniq,
63 Reflex.Dynamic.Uniq,
64 Reflex.DynamicWriter,
64 Reflex.DynamicWriter,
65 Reflex.FunctorMaybe,
65 Reflex.FunctorMaybe,
@@ -76,7 +76,6 @@ library
76 Reflex.Spider,
76 Reflex.Spider,
77 Reflex.Spider.Internal
77 Reflex.Spider.Internal
78
78
79− other-extensions: TemplateHaskell
80 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
79 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
81 ghc-prof-options: -auto-all
80 ghc-prof-options: -auto-all
82
81
@@ -90,6 +89,20 @@ library
90 build-depends: ghc
89 build-depends: ghc
91 exposed-modules: Reflex.Optimizer
90 exposed-modules: Reflex.Optimizer
92
91
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+
93test-suite semantics
106test-suite semantics
94 type: exitcode-stdio-1.0
107 type: exitcode-stdio-1.0
95 main-is: semantics.hs
108 main-is: semantics.hs
src/Reflex.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1-- | This module exports all of the commonly-used functionality of Reflex; if
2-- | This module exports all of the commonly-used functionality of Reflex; if
2-- you are just getting started with Reflex, this is probably what you want.
3-- you are just getting started with Reflex, this is probably what you want.
3module Reflex
4module Reflex
@@ -7,7 +8,9 @@ module Reflex
7import Reflex.Class as X
8import Reflex.Class as X
8import Reflex.EventWriter as X
9import Reflex.EventWriter as X
9import Reflex.Dynamic as X
10import Reflex.Dynamic as X
11+#ifdef USE_TEMPLATE_HASKELL
10import Reflex.Dynamic.TH as X
12import Reflex.Dynamic.TH as X
13+#endif
11import Reflex.Dynamic.Uniq as X
14import Reflex.Dynamic.Uniq as X
12import Reflex.DynamicWriter as X
15import Reflex.DynamicWriter as X
13import Reflex.PerformEvent.Base as X
16import Reflex.PerformEvent.Base as X