Skip to content

Commit a083a76

Browse files
authored
Merge pull request #292 from reflex-frp/release/0.6
Release/0.6
2 parents dece710 + b1c9506 commit a083a76

33 files changed

+671
-471
lines changed

ChangeLog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Revision history for reflex
2+
3+
## 0.6.0.0 -- 2019-03-20
4+
5+
* Deprecate FunctorMaybe in favor of Data.Witherable.Filterable. We still export fmapMaybe, ffilter, etc., but they all rely on Filterable now.
6+
* Rename MonadDynamicWriter to DynamicWriter and add a deprecation for the old name.
7+
* Remove many deprecated functions.
8+
* Add a Num instance for Dynamic.
9+
* Add matchRequestsWithResponses to make it easier to use Requester with protocols that don't do this matching for you.
10+
* Add withRequesterT to map functions over the request and response of a RequesterT.
11+
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
12+
* Add throttleBatchWithLag to Reflex.Time. See that module for details.

Quickref.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ Since MonadHold depends on MonadSample, any [S] function also runs in [H] contex
5757
[ ] mergeWith :: (a -> a -> a) -> [Event a] -> Event a
5858
[ ] leftmost :: [Event a] -> Event a
5959
[ ] mergeList :: [Event a] -> Event (NonEmpty a)
60-
[ ] merge :: GCompare k => DMap (WrapArg Event k) -> Event (DMap k)
60+
[ ] merge :: GCompare k => DMap k Event -> Event (DMap k Identity)
6161
[ ] mergeMap :: Ord k => Map k (Event a) -> Event (Map k a)
6262

6363
-- Efficient one-to-many fanout
64-
[ ] fanMap :: Ord k => Event (Map k a) -> EventSelector (Const2 k a)
65-
[ ] fan :: GCompare k => Event (DMap k) -> EventSelector k
66-
[ ] select :: EventSelector k -> k a -> Event a
67-
[ ] fanEither :: Event (Either a b) -> (Event a, Event b)
68-
[ ] fanThese :: Event (These a b) -> (Event a, Event b)
64+
[ ] fanMap :: Ord k => Event (Map k a) -> EventSelector (Const2 k a)
65+
[ ] fan :: GCompare k => Event (DMap k Identity) -> EventSelector k
66+
[ ] select :: EventSelector k -> k a -> Event a
67+
[ ] fanEither :: Event (Either a b) -> (Event a, Event b)
68+
[ ] fanThese :: Event (These a b) -> (Event a, Event b)
6969

7070
-- Event to Event via function that can sample current values
7171
[ ] push :: (a -> m (Maybe b)) -> Event a -> Event b
@@ -166,7 +166,7 @@ For Events, the returned Event fires whenever the latest Event supplied by the w
166166
-- Flatten Behavior-of-Event to Event. Old Event is used during switchover.
167167
[ ] switch :: Behavior (Event a) -> Event a
168168

169-
-- Flatten Dyanmic-of-Event to Event. New Event is used immediately.
169+
-- Flatten Dynamic-of-Event to Event. New Event is used immediately.
170170
[ ] switchDyn :: Dynamic (Event a) -> Event a
171171

172172
-- Flatten Event-of-Event to Event that fires when both wrapper AND new Event fire.

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
## Reflex
1+
## [Reflex](https://reflex-frp.org/)
22
### Practical Functional Reactive Programming
33

4-
Reflex is an fully-deterministic, higher-order Functional Reactive Programming (FRP) interface and an engine that efficiently implements that interface.
4+
Reflex is a fully-deterministic, higher-order Functional Reactive Programming (FRP) interface and an engine that efficiently implements that interface.
55

66
[Reflex-DOM](https://github.com/reflex-frp/reflex-dom) is a framework built on Reflex that facilitates the development of web pages, including highly-interactive single-page apps.
77

8-
Comprehensive documentation is still a work in progress, but a tutorial for Reflex and Reflex-DOM is available at https://github.com/reflex-frp/reflex-platform and an introductory talk given at the New York Haskell Meetup is available here: [Part 1](https://www.youtube.com/watch?v=mYvkcskJbc4) / [Part 2](https://www.youtube.com/watch?v=3qfc9XFVo2c).
9-
108
A summary of Reflex functions is available in the [quick reference](Quickref.md).
119

12-
### Additional resources
10+
**Visit https://reflex-frp.org/ for more information, tutorials, documentation and [examples](https://examples.reflex-frp.org/).**
11+
12+
### Resources
1313
[Get started with Reflex](https://github.com/reflex-frp/reflex-platform)
1414

1515
[/r/reflexfrp](https://www.reddit.com/r/reflexfrp)
1616

1717
[hackage](https://hackage.haskell.org/package/reflex)
1818

1919
[irc.freenode.net #reflex-frp](http://webchat.freenode.net?channels=%23reflex-frp&uio=d4)
20+
21+
### Hacking
22+
23+
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.
24+
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.

default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
, template-haskell , these, time, transformers
77
, transformers-compat, unbounded-delays, prim-uniq
88
, data-default, filepath, directory, filemanip, ghcjs-base
9-
, monoidal-containers
9+
, monoidal-containers, witherable
1010
, useTemplateHaskell ? true
1111
}:
1212
mkDerivation {
1313
pname = "reflex";
14-
version = "0.5";
14+
version = "0.5.0.1";
1515
src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
1616
libraryHaskellDepends = [
1717
base bifunctors containers dependent-map dependent-sum
@@ -21,7 +21,7 @@ mkDerivation {
2121
transformers-compat prim-uniq
2222
base bifunctors containers deepseq dependent-map dependent-sum
2323
mtl ref-tf split transformers data-default
24-
random time unbounded-delays monoidal-containers
24+
random time unbounded-delays monoidal-containers witherable
2525
] ++ (if ghc.isGhcjs or false then [
2626
ghcjs-base
2727
] else []) ++ (if !useTemplateHaskell then [] else [

reflex.cabal

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: reflex
2-
Version: 0.5
2+
Version: 0.6
33
Synopsis: Higher-order Functional Reactive Programming
44
Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
55
License: BSD3
@@ -15,6 +15,7 @@ bug-reports: https://github.com/reflex-frp/reflex/issues
1515
extra-source-files:
1616
README.md
1717
Quickref.md
18+
ChangeLog.md
1819

1920
flag use-reflex-optimizer
2021
description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
@@ -60,11 +61,12 @@ library
6061
semigroups >= 0.16 && < 0.19,
6162
stm >= 2.4 && < 2.6,
6263
syb >= 0.5 && < 0.8,
63-
these >= 0.4 && < 0.7.6,
64+
these >= 0.4 && < 0.7.7,
6465
time >= 1.4 && < 1.9,
6566
transformers >= 0.2,
6667
transformers-compat >= 0.3,
67-
unbounded-delays >= 0.1.0.0 && < 0.2
68+
unbounded-delays >= 0.1.0.0 && < 0.2,
69+
witherable >= 0.2 && < 0.4
6870

6971
exposed-modules:
7072
Data.AppendMap,
@@ -233,14 +235,16 @@ test-suite RequesterT
233235
main-is: RequesterT.hs
234236
hs-source-dirs: test
235237
build-depends: base
238+
, containers
239+
, deepseq >= 1.3 && < 1.5
236240
, dependent-sum
237241
, dependent-map
238242
, lens
243+
, mtl
239244
, these
240245
, transformers
241246
, reflex
242247
, ref-tf
243-
buildable: False
244248
other-modules:
245249
Reflex.TestPlan
246250
Reflex.Plan.Pure

src/Data/AppendMap.hs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE DeriveFunctor #-}
3-
{-# LANGUAGE DeriveGeneric #-}
4-
{-# LANGUAGE DeriveTraversable #-}
52
{-# LANGUAGE FlexibleContexts #-}
63
{-# LANGUAGE FlexibleInstances #-}
7-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
84
{-# LANGUAGE MultiParamTypeClasses #-}
95
{-# LANGUAGE PatternSynonyms #-}
106
{-# LANGUAGE RoleAnnotations #-}
117
{-# LANGUAGE ScopedTypeVariables #-}
12-
{-# LANGUAGE StandaloneDeriving #-}
138
{-# LANGUAGE TypeFamilies #-}
149
{-# OPTIONS_GHC -fno-warn-orphans #-}
1510
-- | 'Data.Map' with a better 'Monoid' instance
@@ -31,9 +26,9 @@ import qualified Data.Map.Internal.Debug as Map (showTree, showTreeWith)
3126
#else
3227
import qualified Data.Map as Map (showTree, showTreeWith)
3328
#endif
34-
import Data.Map.Monoidal
35-
import Reflex.Class (FunctorMaybe (..))
36-
import Reflex.Patch (Additive, Group (..))
29+
import Data.Witherable (Filterable(..))
30+
import Data.Map.Monoidal (MonoidalMap(..), delete, null, empty)
31+
import qualified Data.Map.Monoidal as M
3732

3833
{-# DEPRECATED AppendMap "Use 'MonoidalMap' instead" #-}
3934
type AppendMap = MonoidalMap
@@ -45,8 +40,8 @@ _unAppendMap = getMonoidalMap
4540
pattern AppendMap :: Map k v -> MonoidalMap k v
4641
pattern AppendMap m = MonoidalMap m
4742

48-
instance FunctorMaybe (MonoidalMap k) where
49-
fmapMaybe = mapMaybe
43+
instance Filterable (MonoidalMap k) where
44+
mapMaybe = M.mapMaybe
5045

5146
-- | Deletes a key, returning 'Nothing' if the result is empty.
5247
nonEmptyDelete :: Ord k => k -> MonoidalMap k a -> Maybe (MonoidalMap k a)
@@ -60,17 +55,12 @@ mapMaybeNoNull :: (a -> Maybe b)
6055
-> MonoidalMap token a
6156
-> Maybe (MonoidalMap token b)
6257
mapMaybeNoNull f as =
63-
let bs = fmapMaybe f as
58+
let bs = mapMaybe f as
6459
in if null bs
6560
then Nothing
6661
else Just bs
6762

6863
-- TODO: Move instances to `Reflex.Patch`
69-
instance (Ord k, Group q) => Group (MonoidalMap k q) where
70-
negateG = map negateG
71-
72-
instance (Ord k, Additive q) => Additive (MonoidalMap k q)
73-
7464
showTree :: forall k a. (Show k, Show a) => MonoidalMap k a -> String
7565
showTree = coerce (Map.showTree :: Map k a -> String)
7666

src/Data/Functor/Misc.hs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,10 @@ module Data.Functor.Misc
3838
, dmapToThese
3939
, eitherToDSum
4040
, dsumToEither
41-
-- * Deprecated functions
42-
, sequenceDmap
43-
, wrapDMap
44-
, rewrapDMap
45-
, unwrapDMap
46-
, unwrapDMapMaybe
47-
, extractFunctorDMap
4841
, ComposeMaybe (..)
4942
) where
5043

51-
import Control.Applicative (Applicative, (<$>))
44+
import Control.Applicative ((<$>))
5245
import Control.Monad.Identity
5346
import Data.Dependent.Map (DMap)
5447
import qualified Data.Dependent.Map as DMap
@@ -249,39 +242,3 @@ newtype ComposeMaybe f a =
249242
ComposeMaybe { getComposeMaybe :: Maybe (f a) } deriving (Show, Eq, Ord)
250243

251244
deriving instance Functor f => Functor (ComposeMaybe f)
252-
253-
--------------------------------------------------------------------------------
254-
-- Deprecated functions
255-
--------------------------------------------------------------------------------
256-
257-
{-# INLINE sequenceDmap #-}
258-
{-# DEPRECATED sequenceDmap "Use 'Data.Dependent.Map.traverseWithKey (\\_ -> fmap Identity)' instead" #-}
259-
-- | Run the actions contained in the 'DMap'
260-
sequenceDmap :: Applicative t => DMap f t -> t (DMap f Identity)
261-
sequenceDmap = DMap.traverseWithKey $ \_ t -> Identity <$> t
262-
263-
{-# DEPRECATED wrapDMap "Use 'Data.Dependent.Map.map (f . runIdentity)' instead" #-}
264-
-- | Replace the 'Identity' functor for a 'DMap''s values with a different functor
265-
wrapDMap :: (forall a. a -> f a) -> DMap k Identity -> DMap k f
266-
wrapDMap f = DMap.map $ f . runIdentity
267-
268-
{-# DEPRECATED rewrapDMap "Use 'Data.Dependent.Map.map' instead" #-}
269-
-- | Replace one functor for a 'DMap''s values with a different functor
270-
rewrapDMap :: (forall (a :: *). f a -> g a) -> DMap k f -> DMap k g
271-
rewrapDMap = DMap.map
272-
273-
{-# DEPRECATED unwrapDMap "Use 'Data.Dependent.Map.map (Identity . f)' instead" #-}
274-
-- | Replace one functor for a 'DMap''s values with the 'Identity' functor
275-
unwrapDMap :: (forall a. f a -> a) -> DMap k f -> DMap k Identity
276-
unwrapDMap f = DMap.map $ Identity . f
277-
278-
{-# DEPRECATED unwrapDMapMaybe "Use 'Data.Dependent.Map.mapMaybeWithKey (\\_ a -> fmap Identity $ f a)' instead" #-}
279-
-- | Like 'unwrapDMap', but possibly delete some values from the DMap
280-
unwrapDMapMaybe :: GCompare k => (forall a. f a -> Maybe a) -> DMap k f -> DMap k Identity
281-
unwrapDMapMaybe f = DMap.mapMaybeWithKey $ \_ a -> Identity <$> f a
282-
283-
{-# DEPRECATED extractFunctorDMap "Use 'mapKeyValuePairsMonotonic (\\(Const2 k :=> Identity v) -> Const2 k :=> v)' instead" #-}
284-
-- | Eliminate the 'Identity' functor in a 'DMap' and replace it with the
285-
-- underlying functor
286-
extractFunctorDMap :: DMap (Const2 k (f v)) Identity -> DMap (Const2 k v) f
287-
extractFunctorDMap = mapKeyValuePairsMonotonic $ \(Const2 k :=> Identity v) -> Const2 k :=> v

src/Reflex.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Reflex.Dynamic.TH as X
1919
import Reflex.Dynamic.Uniq as X
2020
import Reflex.DynamicWriter.Base as X
2121
import Reflex.DynamicWriter.Class as X
22+
import Reflex.NotReady.Class as X
2223
import Reflex.PerformEvent.Base as X
2324
import Reflex.PerformEvent.Class as X
2425
import Reflex.PostBuild.Base as X

0 commit comments

Comments
 (0)