Skip to content

Commit

Permalink
Re-export Data.Map.Monoidal; Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-abrar committed Mar 28, 2019
1 parent 45123e1 commit 66004a0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
* Add withRequesterT to map functions over the request and response of a RequesterT.
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
* Add throttleBatchWithLag to Reflex.Time. See that module for details.

## 0.6.1.0

* Re-export all of Data.Map.Monoidal
* Fix QueryT and RequesterT tests
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}:
mkDerivation {
pname = "reflex";
version = "0.5.0.1";
version = "0.6.1";
src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
libraryHaskellDepends = [
base bifunctors containers dependent-map dependent-sum
Expand Down
2 changes: 1 addition & 1 deletion reflex.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: reflex
Version: 0.6
Version: 0.6.1
Synopsis: Higher-order Functional Reactive Programming
Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
License: BSD3
Expand Down
9 changes: 4 additions & 5 deletions src/Data/AppendMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ import qualified Data.Map.Internal.Debug as Map (showTree, showTreeWith)
#else
import qualified Data.Map as Map (showTree, showTreeWith)
#endif
import Data.Witherable (Filterable(..))
import Data.Map.Monoidal (MonoidalMap(..), delete, null, empty)
import qualified Data.Map.Monoidal as M
import qualified Data.Witherable as W
import Data.Map.Monoidal

{-# DEPRECATED AppendMap "Use 'MonoidalMap' instead" #-}
type AppendMap = MonoidalMap
Expand All @@ -40,8 +39,8 @@ _unAppendMap = getMonoidalMap
pattern AppendMap :: Map k v -> MonoidalMap k v
pattern AppendMap m = MonoidalMap m

instance Filterable (MonoidalMap k) where
mapMaybe = M.mapMaybe
instance W.Filterable (MonoidalMap k) where
mapMaybe = mapMaybe

-- | Deletes a key, returning 'Nothing' if the result is empty.
nonEmptyDelete :: Ord k => k -> MonoidalMap k a -> Maybe (MonoidalMap k a)
Expand Down
2 changes: 1 addition & 1 deletion src/Reflex/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ distributeListOverDynPure =
-- | Combine a 'Dynamic' of a 'Map' of 'Dynamic's into a 'Dynamic'
-- with the current values of the 'Dynamic's in a map.
joinDynThroughMap :: forall t k a. (Reflex t, Ord k) => Dynamic t (Map k (Dynamic t a)) -> Dynamic t (Map k a)
joinDynThroughMap = join . fmap distributeMapOverDynPure
joinDynThroughMap = (distributeMapOverDynPure =<<)

-- | Print the value of the 'Dynamic' when it is first read and on each
-- subsequent change that is observed (as 'traceEvent'), prefixed with the
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/FunctorMaybe.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{-# LANGUAGE CPP #-}
#if MIN_VERSION_base(4,9,0)
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
#endif

-- |
-- Module:
Expand Down
6 changes: 3 additions & 3 deletions test/RequesterT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ main = do
print os5
os6 <- runApp' (unwrapApp delayedPulse) [Just ()]
print os6
let ![[Just [10,9,8,7,6,5,4,3,2,1]]] = os1
let ![[Just [1,3,5,7,9]],[Nothing,Nothing],[Just [2,4,6,8,10]],[Just [2,4,6,8,10],Nothing]] = os2
let ![[Just [1,2,3,4,5,6,7,8,9,10]]] = os1 -- The order is reversed here: see the documentation for 'runRequesterT'
let ![[Just [9,7,5,3,1]],[Nothing,Nothing],[Just [10,8,6,4,2]],[Just [10,8,6,4,2],Nothing]] = os2
let ![[Nothing, Just [2]]] = os3
let ![[Nothing, Just [2]]] = os4
let ![[Nothing, Just [1, 2]]] = os5
let ![[Nothing, Nothing]] = os6
-- let ![[Nothing, Nothing]] = os6 -- TODO re-enable this test after issue #233 has been resolved
return ()

unwrapRequest :: DSum tag RequestInt -> Int
Expand Down

0 comments on commit 66004a0

Please sign in to comment.