on develop help sign in
Add use-reflex-optimizer flag; default to False
496dac1Ryan Trinkle
reflex.cabal+5
@@ -18,6 +18,11 @@ flag specialize-to-spidertimeline-global
18 default: False
18 default: False
19 manual: True
19 manual: True
20
20
21+flag use-reflex-optimizer
22+ description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
23+ default: False
24+ manual: True
25+
21library
26library
22 hs-source-dirs: src
27 hs-source-dirs: src
23 build-depends:
28 build-depends:
src/Data/Functor/Misc.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
@@ -9,7 +10,9 @@
9{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE StandaloneDeriving #-}
12{-# LANGUAGE StandaloneDeriving #-}
13+#ifdef USE_REFLEX_OPTIMIZER
12{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
14{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
15+#endif
13-- | This module provides types and functions with no particular theme, but
16-- | This module provides types and functions with no particular theme, but
14-- which are relevant to the use of 'Functor'-based datastructures like
17-- which are relevant to the use of 'Functor'-based datastructures like
15-- 'Data.Dependent.Map.DMap'.
18-- 'Data.Dependent.Map.DMap'.
src/Data/WeakBag.hs+3
@@ -1,6 +1,9 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE ExistentialQuantification #-}
3{-# LANGUAGE ExistentialQuantification #-}
4+#ifdef USE_REFLEX_OPTIMIZER
3{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
5{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
6+#endif
4-- | This module defines the 'WeakBag' type, which represents a mutable
7-- | This module defines the 'WeakBag' type, which represents a mutable
5-- collection of items that does not cause the items to be retained in memory.
8-- collection of items that does not cause the items to be retained in memory.
6-- This is useful for situations where a value needs to be inspected or modified
9-- This is useful for situations where a value needs to be inspected or modified
src/Reflex/Class.hs+2
@@ -16,7 +16,9 @@
16{-# LANGUAGE TypeFamilies #-}
16{-# LANGUAGE TypeFamilies #-}
17{-# LANGUAGE TypeOperators #-}
17{-# LANGUAGE TypeOperators #-}
18{-# LANGUAGE UndecidableInstances #-}
18{-# LANGUAGE UndecidableInstances #-}
19+#ifdef USE_REFLEX_OPTIMIZER
19{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
20{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
21+#endif
20#ifdef SPECIALIZE_TO_SPIDERTIMELINE_GLOBAL
22#ifdef SPECIALIZE_TO_SPIDERTIMELINE_GLOBAL
21{-# OPTIONS_GHC -Wno-redundant-constraints #-}
23{-# OPTIONS_GHC -Wno-redundant-constraints #-}
22#endif
24#endif
src/Reflex/Dynamic.hs+2
@@ -12,7 +12,9 @@
12{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE TypeFamilies #-}
13{-# LANGUAGE TypeOperators #-}
13{-# LANGUAGE TypeOperators #-}
14{-# LANGUAGE UndecidableInstances #-}
14{-# LANGUAGE UndecidableInstances #-}
15+#ifdef USE_REFLEX_OPTIMIZER
15{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
16{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
17+#endif
16-- | This module contains various functions for working with 'Dynamic' values.
18-- | This module contains various functions for working with 'Dynamic' values.
17-- 'Dynamic' and its primitives have been moved to the 'Reflex' class.
19-- 'Dynamic' and its primitives have been moved to the 'Reflex' class.
18module Reflex.Dynamic
20module Reflex.Dynamic
src/Reflex/Dynamic/TH.hs+3
@@ -1,10 +1,13 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE EmptyDataDecls #-}
2{-# LANGUAGE EmptyDataDecls #-}
2{-# LANGUAGE GADTs #-}
3{-# LANGUAGE GADTs #-}
3{-# LANGUAGE PatternGuards #-}
4{-# LANGUAGE PatternGuards #-}
4{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE TemplateHaskell #-}
6{-# LANGUAGE TemplateHaskell #-}
6{-# LANGUAGE TypeOperators #-}
7{-# LANGUAGE TypeOperators #-}
8+#ifdef USE_REFLEX_OPTIMIZER
7{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
9{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
10+#endif
8-- | Template Haskell helper functions for building complex 'Dynamic' values.
11-- | Template Haskell helper functions for building complex 'Dynamic' values.
9module Reflex.Dynamic.TH (qDyn, unqDyn, mkDyn) where
12module Reflex.Dynamic.TH (qDyn, unqDyn, mkDyn) where
10
13
src/Reflex/Dynamic/Uniq.hs+3
@@ -1,7 +1,10 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE MagicHash #-}
3{-# LANGUAGE MagicHash #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
5+#ifdef USE_REFLEX_OPTIMIZER
4{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
6{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
7+#endif
5-- | This module provides a variation of 'Dynamic' values that uses cheap
8-- | This module provides a variation of 'Dynamic' values that uses cheap
6-- pointer equality checks to reduce the amount of signal propagation needed.
9-- pointer equality checks to reduce the amount of signal propagation needed.
7module Reflex.Dynamic.Uniq
10module Reflex.Dynamic.Uniq
src/Reflex/DynamicWriter.hs+2
@@ -9,7 +9,9 @@
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeFamilies #-}
11{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE UndecidableInstances #-}
12+#ifdef USE_REFLEX_OPTIMIZER
12{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
13{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
14+#endif
13module Reflex.DynamicWriter where
15module Reflex.DynamicWriter where
14
16
15import Control.Monad.Exception
17import Control.Monad.Exception
src/Reflex/Host/Class.hs+2
@@ -10,7 +10,9 @@
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE TypeFamilies #-}
11{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE UndecidableInstances #-}
12{-# LANGUAGE UndecidableInstances #-}
13+#ifdef USE_REFLEX_OPTIMIZER
13{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
14{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
15+#endif
14-- | This module provides the interface for hosting 'Reflex' engines. This
16-- | This module provides the interface for hosting 'Reflex' engines. This
15-- should only be necessary if you're writing a binding or some other library
17-- should only be necessary if you're writing a binding or some other library
16-- that provides a core event loop.
18-- that provides a core event loop.
src/Reflex/PerformEvent/Base.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE GADTs #-}
4{-# LANGUAGE GADTs #-}
@@ -12,7 +13,9 @@
12{-# LANGUAGE TypeFamilies #-}
13{-# LANGUAGE TypeFamilies #-}
13{-# LANGUAGE TypeOperators #-}
14{-# LANGUAGE TypeOperators #-}
14{-# LANGUAGE UndecidableInstances #-}
15{-# LANGUAGE UndecidableInstances #-}
16+#ifdef USE_REFLEX_OPTIMIZER
15{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
17{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
18+#endif
16module Reflex.PerformEvent.Base where
19module Reflex.PerformEvent.Base where
17
20
18import Reflex.Class
21import Reflex.Class
src/Reflex/PostBuild/Class.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
@@ -8,7 +9,9 @@
8{-# LANGUAGE TypeFamilies #-}
9{-# LANGUAGE TypeFamilies #-}
9{-# LANGUAGE TypeOperators #-}
10{-# LANGUAGE TypeOperators #-}
10{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE UndecidableInstances #-}
12+#ifdef USE_REFLEX_OPTIMIZER
11{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
13{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
14+#endif
12module Reflex.PostBuild.Class where
15module Reflex.PostBuild.Class where
13
16
14import Control.Monad.Exception
17import Control.Monad.Exception
src/Reflex/Pure.hs+2
@@ -5,7 +5,9 @@
5{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE TypeFamilies #-}
7{-# LANGUAGE TypeFamilies #-}
8+#ifdef USE_REFLEX_OPTIMIZER
8{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
9{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
10+#endif
9
11
10-- There are two expected orphan instances in this module:
12-- There are two expected orphan instances in this module:
11-- * MonadSample (Pure t) ((->) t)
13-- * MonadSample (Pure t) ((->) t)
src/Reflex/Spider/Internal.hs+2
@@ -17,7 +17,9 @@
17{-# LANGUAGE TypeFamilies #-}
17{-# LANGUAGE TypeFamilies #-}
18{-# LANGUAGE TypeOperators #-}
18{-# LANGUAGE TypeOperators #-}
19{-# LANGUAGE UndecidableInstances #-}
19{-# LANGUAGE UndecidableInstances #-}
20+#ifdef USE_REFLEX_OPTIMIZER
20{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
21{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
22+#endif
21#ifdef SPECIALIZE_TO_SPIDERTIMELINE_GLOBAL
23#ifdef SPECIALIZE_TO_SPIDERTIMELINE_GLOBAL
22{-# OPTIONS_GHC -fno-warn-orphans #-}
24{-# OPTIONS_GHC -fno-warn-orphans #-}
23#endif
25#endif