on develop help sign in
Merge branch 'develop' into ts-fix-fastweakticket-fusion
commit6cb0407a9ad37995ffc859670037a30fb012e3ee authorElliot Cameron <3noch@users.noreply.github.com> dateMon 30 Mar 2020, 17:57 (7 years ago) parent57ddc6f190c3f2
5 files changed+29−11
ChangeLog.md+6 README.md+8−2 src/Reflex/BehaviorWriter/Base.hs+3−3 src/Reflex/BehaviorWriter/Class.hs+11−5 src/Reflex/Query/Class.hs+1−1
ChangeLog.md+6
@@ -1,5 +1,11 @@
11# Revision history for reflex
22
3+## Unreleased
4+
5+* Rename class `MonadBehaviorWriter` -> `BehaviorWriter` for
6+ consistency with `EventWriter`/`DynamicWriter`.
7+* Introduce deprecated alias `MonadBehaviorWriter = BehaviorWriter`.
8+
39## 0.6.4.1
410
511* Fix a bug in the Reflex Profiled transformer where
README.md+8−2
@@ -21,5 +21,11 @@ A summary of Reflex functions is available in the [quick reference](Quickref.md)
2121
2222### Hacking
2323
24−Use the `./scripts/hack-on reflex` script in [Reflex Platform](https://github.com/reflex-frp/reflex-platform) to checkout the source code of `reflex` locally in `reflex-platform/reflex` directory.
25−Then do modifications to the source in place, and use the `./try-reflex` or `./scripts/work-on` scripts to create the shell to test your changes.
24+From the root of a [Reflex
25+Platform](https://github.com/reflex-frp/reflex-platform) checkout, run
26+`./scripts/hack-on haskell-overlays/reflex-packages/dep/reflex`. This
27+will check out the reflex source code into the
28+`haskell-overlays/reflex-packages/dep/reflex` directory. You can then
29+point that checkout at your fork, make changes, etc. Use the
30+`./try-reflex` or `./scripts/work-on` scripts to start a shell in
31+which you can test your changes.
src/Reflex/BehaviorWriter/Base.hs+3−3
@@ -1,6 +1,6 @@
11{-|
22Module: Reflex.BehaviorWriter.Base
3−Description: Implementation of MonadBehaviorWriter
3+Description: Implementation of BehaviorWriter
44-}
55{-# LANGUAGE CPP #-}
66{-# LANGUAGE FlexibleInstances #-}
@@ -46,7 +46,7 @@ import Reflex.Query.Class
4646import Reflex.Requester.Class
4747import Reflex.TriggerEvent.Class
4848
49−-- | A basic implementation of 'MonadBehaviorWriter'.
49+-- | A basic implementation of 'BehaviorWriter'.
5050newtype BehaviorWriterT t w m a = BehaviorWriterT { unBehaviorWriterT :: StateT [Behavior t w] m a }
5151 deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadAsyncException, MonadException) -- The list is kept in reverse order
5252
@@ -89,7 +89,7 @@ instance MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (BehaviorWri
8989 newEventWithTrigger = lift . newEventWithTrigger
9090 newFanEventWithTrigger f = lift $ newFanEventWithTrigger f
9191
92−instance (Monad m, Monoid w, Reflex t) => MonadBehaviorWriter t w (BehaviorWriterT t w m) where
92+instance (Monad m, Monoid w, Reflex t) => BehaviorWriter t w (BehaviorWriterT t w m) where
9393 tellBehavior w = BehaviorWriterT $ modify (w :)
9494
9595instance MonadReader r m => MonadReader r (BehaviorWriterT t w m) where
src/Reflex/BehaviorWriter/Class.hs+11−5
@@ -1,8 +1,9 @@
11{-|
22Module: Reflex.BehaviorWriter.Class
3−Description: This module defines the 'MonadBehaviorWriter' class
3+Description: This module defines the 'BehaviorWriter' class
44-}
55{-# LANGUAGE CPP #-}
6+{-# LANGUAGE ConstraintKinds #-}
67{-# LANGUAGE FlexibleInstances #-}
78{-# LANGUAGE FunctionalDependencies #-}
89{-# LANGUAGE UndecidableInstances #-}
@@ -10,16 +11,21 @@ Description: This module defines the 'MonadBehaviorWriter' class
1011{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
1112#endif
1213module Reflex.BehaviorWriter.Class
13− ( MonadBehaviorWriter (..)
14+ ( MonadBehaviorWriter
15+ , BehaviorWriter(..)
1416 ) where
1517
1618import Control.Monad.Reader (ReaderT, lift)
1719import Reflex.Class (Behavior)
1820
19−-- | 'MonadBehaviorWriter' efficiently collects 'Behavior' values using 'tellBehavior'
21+{-# DEPRECATED MonadBehaviorWriter "Use 'BehaviorWriter' instead" #-}
22+-- | Type synonym for 'BehaviorWriter'
23+type MonadBehaviorWriter = BehaviorWriter
24+
25+-- | 'BehaviorWriter' efficiently collects 'Behavior' values using 'tellBehavior'
2026-- and combines them monoidally to provide a 'Behavior' result.
21−class (Monad m, Monoid w) => MonadBehaviorWriter t w m | m -> t w where
27+class (Monad m, Monoid w) => BehaviorWriter t w m | m -> t w where
2228 tellBehavior :: Behavior t w -> m ()
2329
24−instance MonadBehaviorWriter t w m => MonadBehaviorWriter t w (ReaderT r m) where
30+instance BehaviorWriter t w m => BehaviorWriter t w (ReaderT r m) where
2531 tellBehavior = lift . tellBehavior
src/Reflex/Query/Class.hs+1−1
@@ -125,7 +125,7 @@ instance Group SelectedCount where
125125
126126instance Additive SelectedCount
127127
128−-- | The Semigroup/Monoid/Group instances for a Query containing 'SelectedCount's should use
128+-- | The Semigroup\/Monoid\/Group instances for a Query containing 'SelectedCount's should use
129129-- this function which returns Nothing if the result is 0. This allows the pruning of leaves
130130-- of the 'Query' that are no longer wanted.
131131combineSelectedCounts :: SelectedCount -> SelectedCount -> Maybe SelectedCount