Skip to content

Commit 5f1754f

Browse files
authored
Merge branch 'develop' into develop
2 parents 976e89d + 18595a1 commit 5f1754f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2829
-1074
lines changed

.travis.yml

Lines changed: 165 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,171 @@
1-
# Cache Buster: 0
2-
language: nix
1+
# This Travis job script has been generated by a script via
2+
#
3+
# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
4+
#
5+
# For more information, see https://github.com/haskell-CI/haskell-ci
6+
#
7+
# version: 0.3.20190814
8+
#
9+
language: c
10+
dist: xenial
11+
sudo: required
12+
git:
13+
# whether to recursively clone submodules
14+
submodules: false
315
cache:
416
directories:
5-
- /nix
17+
- $HOME/.cabal/packages
18+
- $HOME/.cabal/store
19+
before_cache:
20+
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
21+
# remove files that are regenerated by 'cabal update'
22+
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
23+
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
24+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
25+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
26+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
27+
- rm -rfv $CABALHOME/packages/head.hackage
628
matrix:
729
include:
8-
- env: COMPILER=ghc7103
9-
- env: COMPILER=ghc821
10-
- env: COMPILER=ghc802
11-
- env: COMPILER=ghcjs
30+
- compiler: ghcjs-8.4
31+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["cabal-install-3.0"]}}
32+
- compiler: ghc-8.6.5
33+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
34+
- compiler: ghc-8.4.4
35+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
36+
- compiler: ghc-8.2.2
37+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
38+
- compiler: ghc-8.0.2
39+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
40+
before_install:
41+
- |
42+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
43+
sudo add-apt-repository -y ppa:hvr/ghcjs;
44+
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
45+
sudo apt-add-repository 'https://deb.nodesource.com/node_8.x xenial main'
46+
sudo apt-get update;
47+
sudo apt-get install $CC cabal-install-3.0 nodejs;
48+
fi
49+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
50+
- WITHCOMPILER="-w $HC"
51+
- |
52+
if echo $CC | grep -q ghcjs; then
53+
GHCJS=true
54+
HC=${HC}js
55+
WITHCOMPILER="--ghcjs ${WITHCOMPILER}js"
56+
else
57+
GHCJS=false;
58+
fi
59+
- if $GHCJS ; then sudo apt-get install -y ghc-8.4.4 ; fi
60+
- if $GHCJS ; then PATH="/opt/ghc/8.4.4/bin:$PATH" ; fi
61+
- HCPKG="$HC-pkg"
62+
- unset CC
63+
- CABAL=/opt/ghc/bin/cabal
64+
- CABALHOME=$HOME/.cabal
65+
- export PATH="$CABALHOME/bin:$PATH"
66+
- TOP=$(pwd)
67+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
68+
- echo $HCNUMVER
69+
- CABAL="$CABAL -vnormal+nowrap+markoutput"
70+
- set -o pipefail
71+
- |
72+
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
73+
echo 'BEGIN { state = "output"; }' >> .colorful.awk
74+
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
75+
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
76+
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
77+
echo ' if (state == "cabal") {' >> .colorful.awk
78+
echo ' print blue($0)' >> .colorful.awk
79+
echo ' } else {' >> .colorful.awk
80+
echo ' print $0' >> .colorful.awk
81+
echo ' }' >> .colorful.awk
82+
echo '}' >> .colorful.awk
83+
- cat .colorful.awk
84+
- |
85+
color_cabal_output () {
86+
awk -f $TOP/.colorful.awk
87+
}
88+
- echo text | color_cabal_output
89+
install:
90+
- ${CABAL} --version
91+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
92+
- node --version
93+
- echo $GHCJS
94+
- TEST=--enable-tests
95+
- BENCH=--enable-benchmarks
96+
- BENCH=--disable-benchmarks
97+
- HEADHACKAGE=false
98+
- rm -f $CABALHOME/config
99+
- |
100+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
101+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
102+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
103+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
104+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
105+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
106+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
107+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
108+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
109+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
110+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
111+
echo "install-dirs user" >> $CABALHOME/config
112+
echo " prefix: $CABALHOME" >> $CABALHOME/config
113+
echo "repository hackage.haskell.org" >> $CABALHOME/config
114+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
115+
- cat $CABALHOME/config
116+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
117+
- travis_retry ${CABAL} v2-update -v
118+
- if $GHCJS ; then (cd /tmp && ${CABAL} v2-install -w ghc-8.4.4 happy) ; fi
119+
# Generate cabal.project
120+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
121+
- touch cabal.project
122+
- |
123+
echo "packages: ." >> cabal.project
124+
- |
125+
- cat cabal.project || true
126+
- cat cabal.project.local || true
127+
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
128+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
129+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
130+
- rm cabal.project.freeze
12131
script:
13-
- set -e
14-
- nix-build -E "with (import <nixpkgs> {}); pkgs.haskell.packages.$COMPILER.callPackage ./default.nix { }"
15-
- nix-collect-garbage -d # This is important to do right before 'script' ends so the cache gets GCed
132+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
133+
# Packaging...
134+
- ${CABAL} v2-sdist all | color_cabal_output
135+
# Unpacking...
136+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
137+
- cd ${DISTDIR} || false
138+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
139+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
140+
- PKGDIR_reflex="$(find . -maxdepth 1 -type d -regex '.*/reflex-[0-9.]*')"
141+
# Generate cabal.project
142+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
143+
- touch cabal.project
144+
- |
145+
echo "packages: ${PKGDIR_reflex}" >> cabal.project
146+
- |
147+
- cat cabal.project || true
148+
- cat cabal.project.local || true
149+
# Building...
150+
# this builds all libraries and executables (without tests/benchmarks)
151+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
152+
# Building with tests and benchmarks...
153+
# build & run tests, build benchmarks
154+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
155+
# Testing...
156+
- if ! $GHCJS ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
157+
# cabal check...
158+
- (cd ${PKGDIR_reflex} && ${CABAL} -vnormal check)
159+
# haddock...
160+
- if ! $GHCJS ; then ${CABAL} v2-haddock $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
161+
# Constraint sets
162+
- rm -rf cabal.project.local
163+
# Constraint set no-th
164+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -use-template-haskell' all | color_cabal_output
165+
# Constraint set old-these
166+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='these <1' all | color_cabal_output
167+
# Constraint set old-witherable
168+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='witherable <0.3.2' all | color_cabal_output
16169

170+
# REGENDATA ["--config=cabal.haskell-ci","cabal.project"]
171+
# EOF

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contribution Guide
2+
3+
Contributions and issue reports are encouraged and appreciated!
4+
5+
- [Opening Issues](#opening-issues)
6+
- [Submitting Changes](#submitting-changes)
7+
- [Guidelines for Commit Messages](#guidelines-for-commit-messages)
8+
- [Guidelines for Pull Requests](#guidelines-for-pull-requests)
9+
- [Code Quality](#code-quality)
10+
- [Documentation](#documentation)
11+
12+
## Opening Issues
13+
14+
Before opening an issue, please check whether your issue has already been reported. Assuming it has not:
15+
16+
* Describe the issue you're encountering or the suggestion you're making
17+
* Include any relevant steps to reproduce or code samples you can. It's always easier for us to debug if we have something that demonstrates the error.
18+
* Let us know what version of reflex you were using. If you're using a github checkout, provide the git hash.
19+
* Describe how you're building reflex (i.e., via reflex-platform, cabal install, stack, obelisk, etc.). If you're using reflex-platform or obelisk, provide the git hash of your checkout.
20+
21+
## Submitting Changes
22+
23+
### Guidelines for Commit Messages
24+
25+
#### Summary Line
26+
The summary line of your commit message should summarize the changes being made. Commit messages should be written in the imperative mood and should describe what happens when the commit is applied.
27+
28+
One way to think about it is that your commit message should be able to complete the sentence:
29+
"When applied, this commit will..."
30+
31+
#### Body
32+
For breaking changes, new features, refactors, or other major changes, the body of the commit message should describe the motivation behind the change in greater detail and may include references to the issue tracker. The body shouldn't repeat code/comments from the diff.
33+
34+
### Guidelines for Pull Requests
35+
36+
Wherever possible, pull requests should add a single feature or fix a single bug. Pull requests should not bundle several unrelated changes.
37+
38+
### Code Quality
39+
40+
#### Warnings
41+
42+
Your pull request should add no new warnings to the project. It should also generally not disable any warnings.
43+
44+
#### Build and Test
45+
46+
Make sure the project builds and that the tests pass! This will generally also be checked by CI before merge, but trying it yourself first means you'll catch problems earlier and your contribution can be merged that much sooner!
47+
48+
#### Dependencies
49+
50+
Include version bounds whenever adding a dependency to the library stanza of the cabal file. Note that libraries added to reflex.cabal also need to be added to default.nix.
51+
52+
### Documentation
53+
54+
#### In the code
55+
We're always striving to improve documentation. Please include [haddock](https://haskell-haddock.readthedocs.io/en/latest/index.html) documentation for any added code, and update the documentation for any code you modify.
56+
57+
#### In the [Changelog](ChangeLog.md)
58+
Add an entry to the changelog when your PR:
59+
* Adds a feature
60+
* Deprecates something
61+
* Includes a breaking change
62+
* Makes any other change that will impact users
63+
64+
#### In the [Readme](README.md)
65+
The readme is the first place a lot of people look for information about the repository. Update any parts of the readme that are affected by your PR.
66+

ChangeLog.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Revision history for reflex
2+
3+
## Unreleased
4+
5+
* Data.WeakBag.traverse and Data.FastWeakBag.traverse have been
6+
renamed to Data.WeakBag.traverse_ and Data.FastWeakBag.traverse_
7+
respectively.
8+
9+
## 0.6.2.4
10+
11+
* Update to monoidal-containers 0.6
12+
13+
## 0.6.2.3
14+
15+
* Add an upper-bound to witherable
16+
17+
## 0.6.2.2
18+
19+
* Support these >= 1. Add `split-these` flag to control whether to use new these/semialign combination or not.
20+
* Update version bounds to fix some CI failures
21+
* Add travis CI configuration
22+
23+
## 0.6.2.1
24+
25+
* Generalize `fan` to `fanG` to take a `DMap` with non-`Identity`
26+
functor:
27+
* `fan` to `fanG`
28+
* `EventSelectorG` for `fanG` result selector.
29+
30+
* Reduce the amount of unsafeCoerce in coercing newtypes under Event/Dynamic/Behavior.
31+
* Add fused ReaderIO for the purpose of coercion (ReaderT's third argument has nominal role preventing automated coerce)
32+
* Add incrementalCoercion/coerceIncremental to go with dynamicCoercion/coerceDynamic
33+
34+
* Generalize merging functions:
35+
`merge` to `mergeG`,
36+
`mergeIncremental` to `mergeIncrementalG`,
37+
`mergeIncrementalWithMove` to `mergeIncrementalWithMoveG`.
38+
39+
* Generalize distribute function:
40+
`distributeDMapOverDynPure` to `distributeDMapOverDynPureG`,
41+
42+
## 0.6.2.0
43+
44+
* Fix `holdDyn` so that it is lazy in its event argument
45+
These produce `DMap`s whose values needn't be `Identity`.
46+
* Stop using the now-deprecated `*Tag` classes (e.g., `ShowTag`).
47+
* Fix `holdDyn` so that it is lazy in its event argument.
48+
49+
## 0.6.1.0
50+
51+
* Re-export all of `Data.Map.Monoidal`
52+
* Fix `QueryT` and `RequesterT` tests
53+
54+
## 0.6.0.0 -- 2019-03-20
55+
56+
* Deprecate `FunctorMaybe` in favor of `Data.Witherable.Filterable`. We still export `fmapMaybe`, `ffilter`, etc., but they all rely on `Filterable` now.
57+
* Rename `MonadDynamicWriter` to `DynamicWriter` and add a deprecation for the old name.
58+
* Remove many deprecated functions.
59+
* Add a `Num` instance for `Dynamic`.
60+
* Add `matchRequestsWithResponses` to make it easier to use `Requester` with protocols that don't do this matching for you.
61+
* Add `withRequesterT` to map functions over the request and response of a `RequesterT`.
62+
* Suppress nil patches in `QueryT` as an optimization. The `Query` type must now have an `Eq` instance.
63+
* Add `throttleBatchWithLag` to `Reflex.Time`. See that module for details.

Quickref.md

Lines changed: 24 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.
@@ -292,3 +292,20 @@ Th typeclasses and their associated annotations include:
292292
[P,T] delay :: NominalDiffTime -> Event t a -> m (Event t a)
293293
```
294294

295+
## Networks
296+
297+
```haskell
298+
-- Functions from Reflex.Network used to deal with Dynamics/Events carrying (m a)
299+
300+
-- Given a Dynamic of network-creating actions, create a network that is recreated whenever the Dynamic updates.
301+
-- The returned Event of network results occurs when the Dynamic does. Note: Often, the type a is an Event,
302+
-- in which case the return value is an Event-of-Events that would typically be flattened (via switchHold).
303+
[P,A] networkView :: Dynamic (m a) -> m (Event a)
304+
305+
-- Given an initial network and an Event of network-creating actions, create a network that is recreated whenever the
306+
-- Event fires. The returned Dynamic of network results occurs when the Event does. Note: Often, the type a is an
307+
-- Event, in which case the return value is a Dynamic-of-Events that would typically be flattened.
308+
[H,A] networkHold :: m a -> Event (m a) -> m (Dynamic a)
309+
310+
-- Render a placeholder network to be shown while another network is not yet done building
311+
[P,A] untilReady :: m a -> m b -> m (a, Event b)

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
## Reflex
1+
## [Reflex](https://reflex-frp.org/)
2+
3+
[![Hackage](https://img.shields.io/hackage/v/reflex.svg)](http://hackage.haskell.org/package/reflex)
4+
25
### Practical Functional Reactive Programming
36

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

69
[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.
710

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-
1011
A summary of Reflex functions is available in the [quick reference](Quickref.md).
1112

12-
### Additional resources
13+
**Visit https://reflex-frp.org/ for more information, tutorials, documentation and [examples](https://examples.reflex-frp.org/).**
14+
15+
### Resources
1316
[Get started with Reflex](https://github.com/reflex-frp/reflex-platform)
1417

1518
[/r/reflexfrp](https://www.reddit.com/r/reflexfrp)
1619

17-
[hackage](https://hackage.haskell.org/package/reflex)
18-
1920
[irc.freenode.net #reflex-frp](http://webchat.freenode.net?channels=%23reflex-frp&uio=d4)
21+
22+
### Hacking
23+
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.

0 commit comments

Comments
 (0)