git.iko.soy/purescript-stream
on master help sign in
feat(stream): start of a stream library
commit6b75d2f2a73b6fe91c6f0daf5180d099a256b218 authorTylor Steinberger <tlsteinberger167@gmail.com> dateSun 12 Mar 2017, 19:48 (10 years ago)
36 files changed+2696
.editorconfig+14 .eslintignore+2 .eslintrc+6 .github/ISSUE_TEMPLATE.md+16 .github/PULL_REQUEST_TEMPLATE.md+8 .gitignore+7 .travis.yml+6 CONTRIBUTING.md+11 LICENSE.md+20 bower.json+19 ffi/Control/Stream/LinkedList.js+47 ffi/Control/Stream/Stream.js+5 ffi/Control/Stream/combinators/drain.js+4 ffi/Control/Stream/combinators/index.js+2 ffi/Control/Stream/combinators/mergeConcurrently.js+123 ffi/Control/Stream/combinators/tap.js+50 ffi/Control/Stream/disposables/Disposable.js+15 ffi/Control/Stream/disposables/MemoizedDisposable.js+17 ffi/Control/Stream/disposables/SettableDisposable.js+29 ffi/Control/Stream/disposables/disposeSafely.js+3 ffi/Control/Stream/disposables/index.js+12 ffi/Control/Stream/index.js+4 ffi/Control/Stream/runEffects.js+28 ffi/Control/Stream/scheduler/ClockTimer.js+48 ffi/Control/Stream/scheduler/PropagateTask.js+30 ffi/Control/Stream/scheduler/ScheduledTask.js+14 ffi/Control/Stream/scheduler/Scheduler.js+99 ffi/Control/Stream/scheduler/Timeline.js+124 ffi/Control/Stream/scheduler/index.js+16 ffi/Control/Stream/sink/IndexSink.js+24 ffi/Control/Stream/sink/index.js+1 package.json+27 rollup.config.js+14 src/Control/Stream.js+688 src/Control/Stream.purs+130 yarn.lock+1033
.editorconfignew file+14
@@ -0,0 +1,14 @@
1+root = true
2+
3+[*]
4+indent_style = space
5+indent_size = 2
6+tab_width = 2
7+end_of_line = lf
8+charset = utf-8
9+trim_trailing_whitespace = true
10+insert_final_newline = true
11+
12+[*.md]
13+trim_trailing_whitespace = false
14+insert_final_newline = false
.eslintignorenew file+2
@@ -0,0 +1,2 @@
1+output/
2+src/
.eslintrcnew file+6
@@ -0,0 +1,6 @@
1+{
2+ "extends": "@most/eslint-config-most",
3+ "rules": {
4+ "comma-dangle": "off"
5+ }
6+}
.github/ISSUE_TEMPLATE.mdnew file+16
@@ -0,0 +1,16 @@
1+<!--
2+Do you need help or have a question? Please ensure your question is thorough.
3+Found a bug? Please fill out the sections below 👍.
4+Show some empathy to the person reading your issue. They are volunteers.
5+-->
6+
7+**Code to reproduce the issue:**
8+
9+
10+**Expected behavior:**
11+
12+
13+**Actual behavior:**
14+
15+
16+**Versions of packages used:**
.github/PULL_REQUEST_TEMPLATE.mdnew file+8
@@ -0,0 +1,8 @@
1+<!--
2+Thank you for your contribution!
3+To help speed up the process of merging your code, check the following:
4+-->
5+
6+- [ ] I added new tests for the issue I fixed or the feature I built
7+- [ ] I ran `yarn test` for the package I'm modifying
8+- [ ] I used `yarn commit` instead of `git commit`
.gitignorenew file+7
@@ -0,0 +1,7 @@
1+/bower_components/
2+/node_modules/
3+/.pulp-cache/
4+/output/
5+/generated-docs/
6+/.psc*
7+/.psa*
.travis.ymlnew file+6
@@ -0,0 +1,6 @@
1+language: node_js
2+
3+node_js:
4+ - 7
5+
6+cache: yarn
CONTRIBUTING.mdnew file+11
@@ -0,0 +1,11 @@
1+# Contributing
2+
3+First of all, thank you so much, we need your help.
4+
5+## Contributing a fix or feature
6+
7+1. Fork the repository
8+2. Switch to a new branch `git checkout -b [branchName]`
9+3. Produce your fix or feature
10+4. Use `yarn commit` instead of `git commit` PLEASE!
11+5. Submit a pull request for review
LICENSE.mdnew file+20
@@ -0,0 +1,20 @@
1+The MIT License (MIT)
2+
3+Copyright (c) 2016 Tylor Steinberger
4+
5+Permission is hereby granted, free of charge, to any person obtaining a copy of
6+this software and associated documentation files (the "Software"), to deal in
7+the Software without restriction, including without limitation the rights to
8+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+the Software, and to permit persons to whom the Software is furnished to do so,
10+subject to the following conditions:
11+
12+The above copyright notice and this permission notice shall be included in all
13+copies or substantial portions of the Software.
14+
15+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bower.jsonnew file+19
@@ -0,0 +1,19 @@
1+{
2+ "name": "tempest",
3+ "ignore": [
4+ "**/.*",
5+ "node_modules",
6+ "bower_components",
7+ "output"
8+ ],
9+ "dependencies": {
10+ "purescript-eff": "^2.0.0",
11+ "purescript-prelude": "^2.5.0",
12+ "purescript-aff-promise": "^0.4.0",
13+ "purescript-aff": "^2.0.3"
14+ },
15+ "devDependencies": {
16+ "purescript-console": "^2.0.0",
17+ "purescript-psci-support": "^2.0.0"
18+ }
19+}
ffi/Control/Stream/LinkedList.jsnew file+47
@@ -0,0 +1,47 @@
1+export class LinkedList {
2+ constructor () {
3+ this.head = null
4+ this.length = 0
5+ }
6+
7+ add (x) {
8+ if (this.head !== null) {
9+ this.head.prev = x
10+ x.next = this.head
11+ }
12+ this.head = x
13+ ++this.length
14+ }
15+
16+ remove (x) { // eslint-disable-line complexity
17+ --this.length
18+ if (x === this.head) {
19+ this.head = this.head.next
20+ }
21+ if (x.next !== null) {
22+ x.next.prev = x.prev
23+ x.next = null
24+ }
25+ if (x.prev !== null) {
26+ x.prev.next = x.next
27+ x.prev = null
28+ }
29+ }
30+
31+ isEmpty () {
32+ return this.length === 0
33+ }
34+
35+ dispose () {
36+ if (this.isEmpty()) return
37+
38+ var x = this.head
39+ this.head = null
40+ this.length = 0
41+
42+ while (x !== null) {
43+ x.dispose()
44+ x = x.next
45+ }
46+ }
47+}
ffi/Control/Stream/Stream.jsnew file+5
@@ -0,0 +1,5 @@
1+export class Stream {
2+ constructor (source) {
3+ this.source = source
4+ }
5+}
ffi/Control/Stream/combinators/drain.jsnew file+4
@@ -0,0 +1,4 @@
1+import { defaultScheduler } from '../scheduler'
2+import { runEffects } from '../runEffects'
3+
4+export const drain = stream => () => runEffects(stream, defaultScheduler)
ffi/Control/Stream/combinators/index.jsnew file+2
@@ -0,0 +1,2 @@
1+export * from './tap'
2+export * from './drain'
ffi/Control/Stream/combinators/mergeConcurrently.jsnew file+123
@@ -0,0 +1,123 @@
1+/** @license MIT License (c) copyright 2010-2016 original author or authors */
2+/** @author Brian Cavalier */
3+/** @author John Hann */
4+
5+import { LinkedList } from '../LinkedList'
6+import { MemoizedDisosable } from '../disposables/MemoizedDisposable'
7+import { id as identity } from '@most/prelude'
8+
9+export const mergeConcurrently = (concurrency, stream) =>
10+ mergeMapConcurrently(identity, concurrency, stream)
11+
12+export const mergeMapConcurrently = (f, concurrency, stream) =>
13+ new MergeConcurrently(f, concurrency, stream)
14+
15+class MergeConcurrently {
16+ constructor (f, concurrency, source) {
17+ this.f = f
18+ this.concurrency = concurrency
19+ this.source = source
20+ }
21+
22+ run (sink, scheduler) {
23+ return new Outer(this.f, this.concurrency, this.source, sink, scheduler)
24+ }
25+}
26+
27+class Outer {
28+ constructor (f, concurrency, source, sink, scheduler) {
29+ this.f = f
30+ this.concurrency = concurrency
31+ this.sink = sink
32+ this.scheduler = scheduler
33+ this.pending = []
34+ this.current = new LinkedList()
35+ this.disposable = new MemoizedDisosable(source.run(this, scheduler))
36+ this.active = true
37+ }
38+
39+ event (t, x) {
40+ this._addInner(t, x)
41+ }
42+
43+ _addInner (t, x) {
44+ if (this.current.length < this.concurrency) {
45+ this._startInner(t, x)
46+ } else {
47+ this.pending.push(x)
48+ }
49+ }
50+
51+ _startInner (t, x) {
52+ try {
53+ this._initInner(t, x)
54+ } catch (e) {
55+ this.error(t, e)
56+ }
57+ }
58+
59+ _initInner (t, x) {
60+ const innerSink = new Inner(t, this, this.sink)
61+ innerSink.disposable = mapAndRun(this.f, x, innerSink, this.scheduler)
62+ this.current.add(innerSink)
63+ }
64+
65+ end (t, x) {
66+ this.active = false
67+ this.disposable.dispose()
68+ this._checkEnd(t, x)
69+ }
70+
71+ dispose () {
72+ this.active = false
73+ this.pending.length = 0
74+ this.disposable.dispose()
75+ this.current.dispose()
76+ }
77+
78+ _endInner (t, x, inner) {
79+ this.current.remove(inner)
80+ inner.dispose()
81+
82+ if (this.pending.length === 0) {
83+ this._checkEnd(t, x)
84+ } else {
85+ this._startInner(t, this.pending.shift())
86+ }
87+ }
88+
89+ _checkEnd (t, x) {
90+ if (!this.active && this.current.isEmpty()) {
91+ this.sink.end(t, x)
92+ }
93+ }
94+}
95+
96+const mapAndRun = (f, x, sink, scheduler) =>
97+ f(x).run(sink, scheduler)
98+
99+class Inner {
100+ constructor (time, outer, sink) {
101+ this.prev = this.next = null
102+ this.time = time
103+ this.outer = outer
104+ this.sink = sink
105+ this.disposable = void 0
106+ }
107+
108+ event (t, x) {
109+ this.sink.event(Math.max(t, this.time), x)
110+ }
111+
112+ end (t, x) {
113+ this.outer._endInner(Math.max(t, this.time), x, this)
114+ }
115+
116+ error (t, e) {
117+ this.outer.error(Math.max(t, this.time), e)
118+ }
119+
120+ dispose () {
121+ return this.disposable.dispose()
122+ }
123+}
ffi/Control/Stream/combinators/tap.jsnew file+50
@@ -0,0 +1,50 @@
1+import { Stream } from '../Stream'
2+import { curry2 } from '@most/prelude'
3+
4+export const tapEnd = curry2((f, stream) => new Stream(new TapEnd(f, stream.source)))
5+
6+export const tapEvent = curry2((f, stream) => new Stream(new TapEvent(f, stream.source)))
7+
8+class TapEvent {
9+ constructor (f, source) {
10+ this.source = source
11+ this.f = f
12+
13+ this.run = sink => scheduler =>
14+ source.run(new TapSink(f, sink))(scheduler)
15+ }
16+}
17+
18+class TapSink {
19+ constructor (f, sink) {
20+ this.event = t => x => {
21+ f(x)()
22+ sink.event(t)(x)
23+ }
24+
25+ this.end = t => {
26+ sink.end(t)
27+ }
28+ }
29+}
30+
31+class TapEnd {
32+ constructor (f, source) {
33+ this.source = source
34+ this.f = f
35+
36+ this.run = sink => scheduler =>
37+ source.run(new TapEndSink(f, sink))(scheduler)
38+ }
39+}
40+
41+class TapEndSink {
42+ constructor (f, sink) {
43+ this.event = t => x => sink.event(t)(x)
44+
45+ this.end = t => {
46+ f()
47+ sink.end(t)
48+ }
49+ }
50+}
ffi/Control/Stream/disposables/Disposable.jsnew file+15
@@ -0,0 +1,15 @@
1+export class Disposable {
2+ /**
3+ * Create a new Disposable which will dispose its underlying resource.
4+ * @param {function} dispose function
5+ * @param {*?} data any data to be passed to disposer function
6+ */
7+ constructor (dispose, data) {
8+ this._dispose = dispose
9+ this._data = data
10+ }
11+
12+ dispose () {
13+ return this._dispose(this._data)
14+ }
15+}
ffi/Control/Stream/disposables/MemoizedDisposable.jsnew file+17
@@ -0,0 +1,17 @@
1+export class MemoizedDisposable {
2+ constructor (disposable) {
3+ this.disposed = false
4+ this.value = undefined
5+ this.disposable = disposable
6+ }
7+
8+ dispose () {
9+ if (!this.disposed) {
10+ this.disposed = true
11+ this.value = disposeSafely(this.disposable)
12+ this.disposable = undefined
13+ }
14+
15+ return this.value
16+ }
17+}
ffi/Control/Stream/disposables/SettableDisposable.jsnew file+29
@@ -0,0 +1,29 @@
1+export class SettableDisposable {
2+ constructor () {
3+ this.disposable = void 0
4+ this.disposed = false
5+ this.result = void 0
6+ }
7+
8+ setDisposable (disposable) {
9+ this.disposable = disposable
10+
11+ if (this.disposed) {
12+ this.result = disposable.dispose()
13+ }
14+ }
15+
16+ dispose () {
17+ if (this.disposed) {
18+ return this.result
19+ }
20+
21+ this.disposed = true
22+
23+ if (this.disposable !== void 0) {
24+ this.result = this.disposable.dispose()
25+ }
26+
27+ return this.result
28+ }
29+}
ffi/Control/Stream/disposables/disposeSafely.jsnew file+3
@@ -0,0 +1,3 @@
1+export function disposeSafely (disposable) {
2+ disposable.dispose()
3+}
ffi/Control/Stream/disposables/index.jsnew file+12
@@ -0,0 +1,12 @@
1+import { curry2, id, map } from '@most/prelude'
2+
3+import { Disposable } from './Disposable'
4+import { MemoizedDisposable } from './MemoizedDisposable'
5+import { disposeSafely } from './disposeSafely'
6+
7+export const createDisposable = curry2((dispose, data) => new MemoizedDisposable(new Disposable(dispose, data)))
8+
9+export const emptyDisposable = new Disposable(id, undefined)
10+
11+export const disposeAll = disposables =>
12+ createDisposable(map(disposeSafely, disposables), disposables)
ffi/Control/Stream/index.jsnew file+4
@@ -0,0 +1,4 @@
1+/* @flow */
2+export * from './disposables'
3+export * from './scheduler'
4+export * from './combinators'
ffi/Control/Stream/runEffects.jsnew file+28
@@ -0,0 +1,28 @@
1+import { SettableDisposable } from './disposables/SettableDisposable'
2+
3+export function runEffects (stream, scheduler) {
4+ return runSourceEffects(stream.source, scheduler)
5+}
6+
7+const runSourceEffects = (source, scheduler) => runSource(source, scheduler)
8+
9+function runSource (source, scheduler) {
10+ const disposable = new SettableDisposable()
11+ const observer = new RunEffectsSink(disposable)
12+
13+ disposable.setDisposable(source.run(observer)(scheduler))
14+}
15+
16+var RunEffectsSink = function RunEffectsSink (disposable) {
17+ this._disposable = disposable
18+ this.active = true
19+}
20+
21+RunEffectsSink.prototype.event = function event (t) {
22+ return function (x) {}
23+}
24+
25+RunEffectsSink.prototype.end = function end (t) {
26+ this.active = false
27+ Promise.resolve(this._disposable).then(d => d.dispose())
28+}
ffi/Control/Stream/scheduler/ClockTimer.jsnew file+48
@@ -0,0 +1,48 @@
1+/** @license MIT License (c) copyright 2010-2016 original author or authors */
2+/** @author Brian Cavalier */
3+/** @author John Hann */
4+
5+/*global setTimeout, clearTimeout*/
6+
7+export function defer (task) {
8+ return Promise.resolve(task).then(runTask)
9+}
10+
11+export function runTask (task) {
12+ return task.run()
13+}
14+
15+export class ClockTimer {
16+ constructor () {
17+ this.now = Date.now
18+ }
19+
20+ setTimer (f, dt) {
21+ return dt <= 0 ? runAsap(f) : setTimeout(f, dt)
22+ }
23+
24+ clearTimer (t) {
25+ return t instanceof Asap ? t.cancel() : clearTimeout(t)
26+ }
27+}
28+
29+class Asap {
30+ constructor (f) {
31+ this.f = f
32+ this.active = true
33+ }
34+
35+ run () {
36+ return this.active && this.f()
37+ }
38+
39+ cancel () {
40+ this.active = false
41+ }
42+}
43+
44+function runAsap (f) {
45+ const task = new Asap(f)
46+ defer(task)
47+ return task
48+}
ffi/Control/Stream/scheduler/PropagateTask.jsnew file+30
@@ -0,0 +1,30 @@
1+import { curry2, curry3 } from '@most/prelude'
2+
3+const propagateTask =
4+ curry3((run, value, sink) => new PropagateTask(run, value, sink))
5+
6+export const eventTask =
7+ curry2((value, sink) => propagateTask(runEvent, value, sink))
8+
9+export const endTask = sink => propagateTask(runEnd, void 0, sink)
10+
11+class PropagateTask {
12+ constructor (run, value, sink) {
13+ let active = true
14+
15+ this.dispose = () => { active = false }
16+ this.run = t => {
17+ if (!active) return
18+
19+ run(t, value, sink)
20+ }
21+ }
22+}
23+
24+function runEvent (time, value, sink) {
25+ sink.event(time)(value)
26+}
27+
28+function runEnd (time, value, sink) {
29+ sink.end(time, value)
30+}
ffi/Control/Stream/scheduler/ScheduledTask.jsnew file+14
@@ -0,0 +1,14 @@
1+/* @flow */
2+export function ScheduledTask (delay, period, task, scheduler) {
3+ this.time = delay
4+ this.period = period
5+ this.task = task
6+ this.scheduler = scheduler
7+ this.active = true
8+
9+ this.run = () => task.run(this.time)
10+ this.dispose = () => {
11+ scheduler.cancel(this)
12+ task.dispose()
13+ }
14+}
ffi/Control/Stream/scheduler/Scheduler.jsnew file+99
@@ -0,0 +1,99 @@
1+/* @flow */
2+import { ScheduledTask } from './ScheduledTask'
3+
4+function runTask (task) {
5+ try {
6+ return task.run()
7+ } catch (e) {
8+ console.error(e)
9+ }
10+}
11+
12+export class Scheduler {
13+ constructor (timer, timeline) {
14+ this.timer = timer
15+ this.timeline = timeline
16+
17+ this._timer = null
18+ this._nextArrival = Infinity
19+
20+ this._runReadyTasksBound = () => this._runReadyTasks(this.now())
21+ }
22+
23+ now () {
24+ return this.timer.now()
25+ }
26+
27+ asap (task) {
28+ return this.schedule(0, -1, task)
29+ }
30+
31+ delay (delay, task) {
32+ return this.schedule(delay, -1, task)
33+ }
34+
35+ periodic (period, task) {
36+ return this.schedule(0, period, task)
37+ }
38+
39+ schedule (delay, period, task) {
40+ const now = this.now()
41+ const st = new ScheduledTask(now + Math.max(0, delay), period, task, this)
42+
43+ this.timeline.add(st)
44+ this._scheduleNextRun(now)
45+ return st
46+ }
47+
48+ cancel (task) {
49+ task.active = false
50+ if (this.timeline.remove(task)) {
51+ this._reschedule()
52+ }
53+ }
54+
55+ cancelAll (f) {
56+ this.timeline.removeAll(f)
57+ this._reschedule()
58+ }
59+
60+ _reschedule () {
61+ if (this.timeline.isEmpty()) {
62+ this._unschedule()
63+ } else {
64+ this._scheduleNextRun(this.now())
65+ }
66+ }
67+
68+ _unschedule () {
69+ this.timer.clearTimer(this._timer)
70+ this._timer = null
71+ }
72+
73+ _scheduleNextRun (now) { // eslint-disable-line complexity
74+ if (this.timeline.isEmpty()) {
75+ return
76+ }
77+
78+ const nextArrival = this.timeline.nextArrival()
79+
80+ if (this._timer === null) {
81+ this._scheduleNextArrival(nextArrival, now)
82+ } else if (nextArrival < this._nextArrival) {
83+ this._unschedule()
84+ this._scheduleNextArrival(nextArrival, now)
85+ }
86+ }
87+
88+ _scheduleNextArrival (nextArrival, now) {
89+ this._nextArrival = nextArrival
90+ const delay = Math.max(0, nextArrival - now)
91+ this._timer = this.timer.setTimer(this._runReadyTasksBound, delay)
92+ }
93+
94+ _runReadyTasks (now) {
95+ this._timer = null
96+ this.timeline.runTasks(now, runTask)
97+ this._scheduleNextRun(this.now())
98+ }
99+}
ffi/Control/Stream/scheduler/Timeline.jsnew file+124
@@ -0,0 +1,124 @@
1+/** @license MIT License (c) copyright 2010-2016 original author or authors */
2+/** @author Brian Cavalier */
3+/** @author John Hann */
4+
5+import * as base from '@most/prelude'
6+
7+export class Timeline {
8+ constructor () {
9+ this.tasks = []
10+ }
11+
12+ nextArrival () {
13+ return this.isEmpty() ? Infinity : this.tasks[0].time
14+ }
15+
16+ isEmpty () {
17+ return this.tasks.length === 0
18+ }
19+
20+ add (st) {
21+ insertByTime(st, this.tasks)
22+ }
23+
24+ remove (st) {
25+ const i = binarySearch(st.time, this.tasks)
26+
27+ if (i >= 0 && i < this.tasks.length) {
28+ const at = base.findIndex(st, this.tasks[i].events)
29+ if (at >= 0) {
30+ this.tasks[i].events.splice(at, 1)
31+ return true
32+ }
33+ }
34+
35+ return false
36+ }
37+
38+ removeAll (f) {
39+ for (let i = 0; i < this.tasks.length; ++i) {
40+ removeAllFrom(f, this.tasks[i])
41+ }
42+ }
43+
44+ runTasks (t, runTask) {
45+ const tasks = this.tasks
46+ const l = tasks.length
47+ let i = 0
48+
49+ while (i < l && tasks[i].time <= t) {
50+ ++i
51+ }
52+
53+ this.tasks = tasks.slice(i)
54+
55+ // Run all ready tasks
56+ for (let j = 0; j < i; ++j) {
57+ this.tasks = runReadyTasks(runTask, tasks[j].events, this.tasks)
58+ }
59+ }
60+}
61+
62+function runReadyTasks (runTask, events, tasks) { // eslint-disable-line complexity
63+ for (let i = 0; i < events.length; ++i) {
64+ const task = events[i]
65+
66+ if (task.active) {
67+ runTask(task)
68+
69+ // Reschedule periodic repeating tasks
70+ // Check active again, since a task may have canceled itself
71+ if (task.period >= 0 && task.active) {
72+ task.time = task.time + task.period
73+ insertByTime(task, tasks)
74+ }
75+ }
76+ }
77+
78+ return tasks
79+}
80+
81+function insertByTime (task, timeslots) { // eslint-disable-line complexity
82+ const l = timeslots.length
83+
84+ if (l === 0) {
85+ timeslots.push(newTimeslot(task.time, [task]))
86+ return
87+ }
88+
89+ const i = binarySearch(task.time, timeslots)
90+
91+ if (i >= l) {
92+ timeslots.push(newTimeslot(task.time, [task]))
93+ } else if (task.time === timeslots[i].time) {
94+ timeslots[i].events.push(task)
95+ } else {
96+ timeslots.splice(i, 0, newTimeslot(task.time, [task]))
97+ }
98+}
99+
100+function removeAllFrom (f, timeslot) {
101+ timeslot.events = base.removeAll(f, timeslot.events)
102+}
103+
104+function binarySearch (t, sortedArray) { // eslint-disable-line complexity
105+ let lo = 0
106+ let hi = sortedArray.length
107+ let mid, y
108+
109+ while (lo < hi) {
110+ mid = Math.floor((lo + hi) / 2)
111+ y = sortedArray[mid]
112+
113+ if (t === y.time) {
114+ return mid
115+ } else if (t < y.time) {
116+ hi = mid
117+ } else {
118+ lo = mid + 1
119+ }
120+ }
121+ return hi
122+}
123+
124+const newTimeslot = (t, events) => ({ time: t, events: events })
ffi/Control/Stream/scheduler/index.jsnew file+16
@@ -0,0 +1,16 @@
1+import { ClockTimer } from './ClockTimer'
2+import { Scheduler } from './Scheduler'
3+import { Timeline } from './Timeline'
4+import { curry2 } from '@most/prelude'
5+
6+export { endTask, eventTask } from './PropagateTask'
7+
8+export const defaultScheduler = new Scheduler(new ClockTimer(), new Timeline())
9+
10+export const scheduleTasks = curry2((tasks, scheduler) => {
11+ const scheduledTasks = tasks.map(task => scheduler.asap(task))
12+
13+ return {
14+ dispose: () => scheduledTasks.forEach(task => task.dispose())
15+ }
16+})
ffi/Control/Stream/sink/IndexSink.jsnew file+24
@@ -0,0 +1,24 @@
1+export class IndexSink {
2+ constructor (i, sink) {
3+ this.sink = sink
4+ this.index = i
5+ this.active = true
6+ this.value = void 0
7+ }
8+
9+ event (t) {
10+ return x => {
11+ if (!this.active) return
12+
13+ this.value = x
14+ this.sink.event(t)(this)
15+ }
16+ }
17+
18+ end (t, x) {
19+ if (!this.active) return
20+
21+ this.active = false
22+ this.sink.end(t, { index: this.index, value: x })
23+ }
24+}
ffi/Control/Stream/sink/index.jsnew file+1
@@ -0,0 +1 @@
1+export * from './IndexSink'
package.jsonnew file+27
@@ -0,0 +1,27 @@
1+{
2+ "name": "purescript-tempest",
3+ "version": "0.0.0",
4+ "description": "",
5+ "main": "index.js",
6+ "scripts": {
7+ "test": "echo \"Error: no test specified\" && exit 1",
8+ "build": "rollup -c && pulp build"
9+ },
10+ "author": "Tylor Steinberger",
11+ "license": "MIT",
12+ "devDependencies": {
13+ "@most/eslint-config-most": "^1.0.3",
14+ "eslint": "^3.17.1",
15+ "eslint-config-standard": "^7.0.1",
16+ "eslint-plugin-promise": "^3.5.0",
17+ "eslint-plugin-standard": "^2.1.1",
18+ "rollup": "^0.41.4",
19+ "rollup-plugin-buble": "^0.15.0",
20+ "rollup-plugin-flow": "^1.1.1",
21+ "rollup-plugin-node-resolve": "^2.0.0",
22+ "uglify-js": "^2.8.11"
23+ },
24+ "dependencies": {
25+ "@most/prelude": "^1.5.0"
26+ }
27+}
rollup.config.jsnew file+14
@@ -0,0 +1,14 @@
1+import buble from 'rollup-plugin-buble'
2+import flow from 'rollup-plugin-flow'
3+import resolve from 'rollup-plugin-node-resolve'
4+
5+export default {
6+ entry: 'ffi/Control/Stream/index.js',
7+ dest: 'src/Control/Stream.js',
8+ format: 'cjs',
9+ plugins: [
10+ flow(),
11+ buble(),
12+ resolve({ module: true, jsnext: true })
13+ ]
14+}
src/Control/Stream.jsnew file+688
@@ -0,0 +1,688 @@
1+'use strict';
2+
3+Object.defineProperty(exports, '__esModule', { value: true });
4+
5+/** @license MIT License (c) copyright 2010-2016 original author or authors */
6+
7+// Non-mutating array operations
8+
9+// cons :: a -> [a] -> [a]
10+// a with x prepended
11+
12+
13+// append :: a -> [a] -> [a]
14+// a with x appended
15+
16+
17+// drop :: Int -> [a] -> [a]
18+// drop first n elements
19+
20+
21+// tail :: [a] -> [a]
22+// drop head element
23+
24+
25+// copy :: [a] -> [a]
26+// duplicate a (shallow duplication)
27+
28+
29+// map :: (a -> b) -> [a] -> [b]
30+// transform each element with f
31+function map (f, a) {
32+ var l = a.length;
33+ var b = new Array(l);
34+ for (var i = 0; i < l; ++i) {
35+ b[i] = f(a[i]);
36+ }
37+ return b
38+}
39+
40+// reduce :: (a -> b -> a) -> a -> [b] -> a
41+// accumulate via left-fold
42+
43+
44+// replace :: a -> Int -> [a]
45+// replace element at index
46+
47+
48+// remove :: Int -> [a] -> [a]
49+// remove element at index
50+
51+
52+// removeAll :: (a -> boolean) -> [a] -> [a]
53+// remove all elements matching a predicate
54+function removeAll (f, a) {
55+ var l = a.length;
56+ var b = new Array(l);
57+ var j = 0;
58+ for (var x = (void 0), i = 0; i < l; ++i) {
59+ x = a[i];
60+ if (!f(x)) {
61+ b[j] = x;
62+ ++j;
63+ }
64+ }
65+
66+ b.length = j;
67+ return b
68+}
69+
70+// findIndex :: a -> [a] -> Int
71+// find index of x in a, from the left
72+function findIndex (x, a) {
73+ for (var i = 0, l = a.length; i < l; ++i) {
74+ if (x === a[i]) {
75+ return i
76+ }
77+ }
78+ return -1
79+}
80+
81+// isArrayLike :: * -> boolean
82+// Return true iff x is array-like
83+
84+/** @license MIT License (c) copyright 2010-2016 original author or authors */
85+
86+// id :: a -> a
87+var id = function (x) { return x; };
88+
89+// compose :: (b -> c) -> (a -> b) -> (a -> c)
90+
91+
92+// apply :: (a -> b) -> a -> b
93+
94+
95+// curry2 :: ((a, b) -> c) -> (a -> b -> c)
96+function curry2 (f) {
97+ function curried (a, b) {
98+ switch (arguments.length) {
99+ case 0: return curried
100+ case 1: return function (b) { return f(a, b); }
101+ default: return f(a, b)
102+ }
103+ }
104+ return curried
105+}
106+
107+// curry3 :: ((a, b, c) -> d) -> (a -> b -> c -> d)
108+function curry3 (f) {
109+ function curried (a, b, c) { // eslint-disable-line complexity
110+ switch (arguments.length) {
111+ case 0: return curried
112+ case 1: return curry2(function (b, c) { return f(a, b, c); })
113+ case 2: return function (c) { return f(a, b, c); }
114+ default:return f(a, b, c)
115+ }
116+ }
117+ return curried
118+}
119+
120+// curry4 :: ((a, b, c, d) -> e) -> (a -> b -> c -> d -> e)
121+
122+/** @license MIT License (c) copyright 2016 original author or authors */
123+
124+var Disposable = function Disposable (dispose, data) {
125+ this._dispose = dispose;
126+ this._data = data;
127+};
128+
129+Disposable.prototype.dispose = function dispose () {
130+ return this._dispose(this._data)
131+};
132+
133+var MemoizedDisposable = function MemoizedDisposable (disposable) {
134+ this.disposed = false;
135+ this.value = undefined;
136+ this.disposable = disposable;
137+};
138+
139+MemoizedDisposable.prototype.dispose = function dispose () {
140+ if (!this.disposed) {
141+ this.disposed = true;
142+ this.value = disposeSafely(this.disposable);
143+ this.disposable = undefined;
144+ }
145+
146+ return this.value
147+};
148+
149+function disposeSafely$1 (disposable) {
150+ disposable.dispose();
151+}
152+
153+var createDisposable = curry2(function (dispose, data) { return new MemoizedDisposable(new Disposable(dispose, data)); });
154+
155+var emptyDisposable = new Disposable(id, undefined);
156+
157+var disposeAll = function (disposables) { return createDisposable(map(disposeSafely$1, disposables), disposables); };
158+
159+/** @license MIT License (c) copyright 2010-2016 original author or authors */
160+/** @author Brian Cavalier */
161+/** @author John Hann */
162+
163+/*global setTimeout, clearTimeout*/
164+
165+function defer (task) {
166+ return Promise.resolve(task).then(runTask)
167+}
168+
169+function runTask (task) {
170+ return task.run()
171+}
172+
173+var ClockTimer = function ClockTimer () {
174+ this.now = Date.now;
175+};
176+
177+ClockTimer.prototype.setTimer = function setTimer (f, dt) {
178+ return dt <= 0 ? runAsap(f) : setTimeout(f, dt)
179+};
180+
181+ClockTimer.prototype.clearTimer = function clearTimer (t) {
182+ return t instanceof Asap ? t.cancel() : clearTimeout(t)
183+};
184+
185+var Asap = function Asap (f) {
186+ this.f = f;
187+ this.active = true;
188+};
189+
190+Asap.prototype.run = function run () {
191+ return this.active && this.f()
192+};
193+
194+Asap.prototype.cancel = function cancel () {
195+ this.active = false;
196+};
197+
198+function runAsap (f) {
199+ var task = new Asap(f);
200+ defer(task);
201+ return task
202+}
203+
204+/* */
205+function ScheduledTask (delay, period, task, scheduler) {
206+ var this$1 = this;
207+
208+ this.time = delay;
209+ this.period = period;
210+ this.task = task;
211+ this.scheduler = scheduler;
212+ this.active = true;
213+
214+ this.run = function () { return task.run(this$1.time); };
215+ this.dispose = function () {
216+ scheduler.cancel(this$1);
217+ task.dispose();
218+ };
219+}
220+
221+/* */
222+function runTask$1 (task) {
223+ try {
224+ return task.run()
225+ } catch (e) {
226+ console.error(e);
227+ }
228+}
229+
230+var Scheduler = function Scheduler (timer, timeline) {
231+ var this$1 = this;
232+
233+ this.timer = timer;
234+ this.timeline = timeline;
235+
236+ this._timer = null;
237+ this._nextArrival = Infinity;
238+
239+ this._runReadyTasksBound = function () { return this$1._runReadyTasks(this$1.now()); };
240+};
241+
242+Scheduler.prototype.now = function now () {
243+ return this.timer.now()
244+};
245+
246+Scheduler.prototype.asap = function asap (task) {
247+ return this.schedule(0, -1, task)
248+};
249+
250+Scheduler.prototype.delay = function delay (delay$1, task) {
251+ return this.schedule(delay$1, -1, task)
252+};
253+
254+Scheduler.prototype.periodic = function periodic (period, task) {
255+ return this.schedule(0, period, task)
256+};
257+
258+Scheduler.prototype.schedule = function schedule (delay, period, task) {
259+ var now = this.now();
260+ var st = new ScheduledTask(now + Math.max(0, delay), period, task, this);
261+
262+ this.timeline.add(st);
263+ this._scheduleNextRun(now);
264+ return st
265+};
266+
267+Scheduler.prototype.cancel = function cancel (task) {
268+ task.active = false;
269+ if (this.timeline.remove(task)) {
270+ this._reschedule();
271+ }
272+};
273+
274+Scheduler.prototype.cancelAll = function cancelAll (f) {
275+ this.timeline.removeAll(f);
276+ this._reschedule();
277+};
278+
279+Scheduler.prototype._reschedule = function _reschedule () {
280+ if (this.timeline.isEmpty()) {
281+ this._unschedule();
282+ } else {
283+ this._scheduleNextRun(this.now());
284+ }
285+};
286+
287+Scheduler.prototype._unschedule = function _unschedule () {
288+ this.timer.clearTimer(this._timer);
289+ this._timer = null;
290+};
291+
292+Scheduler.prototype._scheduleNextRun = function _scheduleNextRun (now) { // eslint-disable-line complexity
293+ if (this.timeline.isEmpty()) {
294+ return
295+ }
296+
297+ var nextArrival = this.timeline.nextArrival();
298+
299+ if (this._timer === null) {
300+ this._scheduleNextArrival(nextArrival, now);
301+ } else if (nextArrival < this._nextArrival) {
302+ this._unschedule();
303+ this._scheduleNextArrival(nextArrival, now);
304+ }
305+};
306+
307+Scheduler.prototype._scheduleNextArrival = function _scheduleNextArrival (nextArrival, now) {
308+ this._nextArrival = nextArrival;
309+ var delay = Math.max(0, nextArrival - now);
310+ this._timer = this.timer.setTimer(this._runReadyTasksBound, delay);
311+};
312+
313+Scheduler.prototype._runReadyTasks = function _runReadyTasks (now) {
314+ this._timer = null;
315+ this.timeline.runTasks(now, runTask$1);
316+ this._scheduleNextRun(this.now());
317+};
318+
319+/** @license MIT License (c) copyright 2010-2016 original author or authors */
320+/** @author Brian Cavalier */
321+/** @author John Hann */
322+
323+var Timeline = function Timeline () {
324+ this.tasks = [];
325+};
326+
327+Timeline.prototype.nextArrival = function nextArrival () {
328+ return this.isEmpty() ? Infinity : this.tasks[0].time
329+};
330+
331+Timeline.prototype.isEmpty = function isEmpty () {
332+ return this.tasks.length === 0
333+};
334+
335+Timeline.prototype.add = function add (st) {
336+ insertByTime(st, this.tasks);
337+};
338+
339+Timeline.prototype.remove = function remove$$1 (st) {
340+ var i = binarySearch(st.time, this.tasks);
341+
342+ if (i >= 0 && i < this.tasks.length) {
343+ var at = findIndex(st, this.tasks[i].events);
344+ if (at >= 0) {
345+ this.tasks[i].events.splice(at, 1);
346+ return true
347+ }
348+ }
349+
350+ return false
351+};
352+
353+Timeline.prototype.removeAll = function removeAll$$1 (f) {
354+ var this$1 = this;
355+
356+ for (var i = 0; i < this.tasks.length; ++i) {
357+ removeAllFrom(f, this$1.tasks[i]);
358+ }
359+};
360+
361+Timeline.prototype.runTasks = function runTasks (t, runTask) {
362+ var this$1 = this;
363+
364+ var tasks = this.tasks;
365+ var l = tasks.length;
366+ var i = 0;
367+
368+ while (i < l && tasks[i].time <= t) {
369+ ++i;
370+ }
371+
372+ this.tasks = tasks.slice(i);
373+
374+ // Run all ready tasks
375+ for (var j = 0; j < i; ++j) {
376+ this$1.tasks = runReadyTasks(runTask, tasks[j].events, this$1.tasks);
377+ }
378+};
379+
380+function runReadyTasks (runTask, events, tasks) { // eslint-disable-line complexity
381+ for (var i = 0; i < events.length; ++i) {
382+ var task = events[i];
383+
384+ if (task.active) {
385+ runTask(task);
386+
387+ // Reschedule periodic repeating tasks
388+ // Check active again, since a task may have canceled itself
389+ if (task.period >= 0 && task.active) {
390+ task.time = task.time + task.period;
391+ insertByTime(task, tasks);
392+ }
393+ }
394+ }
395+
396+ return tasks
397+}
398+
399+function insertByTime (task, timeslots) { // eslint-disable-line complexity
400+ var l = timeslots.length;
401+
402+ if (l === 0) {
403+ timeslots.push(newTimeslot(task.time, [task]));
404+ return
405+ }
406+
407+ var i = binarySearch(task.time, timeslots);
408+
409+ if (i >= l) {
410+ timeslots.push(newTimeslot(task.time, [task]));
411+ } else if (task.time === timeslots[i].time) {
412+ timeslots[i].events.push(task);
413+ } else {
414+ timeslots.splice(i, 0, newTimeslot(task.time, [task]));
415+ }
416+}
417+
418+function removeAllFrom (f, timeslot) {
419+ timeslot.events = removeAll(f, timeslot.events);
420+}
421+
422+function binarySearch (t, sortedArray) { // eslint-disable-line complexity
423+ var lo = 0;
424+ var hi = sortedArray.length;
425+ var mid, y;
426+
427+ while (lo < hi) {
428+ mid = Math.floor((lo + hi) / 2);
429+ y = sortedArray[mid];
430+
431+ if (t === y.time) {
432+ return mid
433+ } else if (t < y.time) {
434+ hi = mid;
435+ } else {
436+ lo = mid + 1;
437+ }
438+ }
439+ return hi
440+}
441+
442+var newTimeslot = function (t, events) { return ({ time: t, events: events }); };
443+
444+var propagateTask =
445+ curry3(function (run, value, sink) { return new PropagateTask(run, value, sink); });
446+
447+var eventTask =
448+ curry2(function (value, sink) { return propagateTask(runEvent, value, sink); });
449+
450+var endTask = function (sink) { return propagateTask(runEnd, void 0, sink); };
451+
452+var PropagateTask = function PropagateTask (run, value, sink) {
453+ var active = true;
454+
455+ this.dispose = function () { active = false; };
456+ this.run = function (t) {
457+ if (!active) { return }
458+
459+ run(t, value, sink);
460+ };
461+};
462+
463+function runEvent (time, value, sink) {
464+ sink.event(time)(value);
465+}
466+
467+function runEnd (time, value, sink) {
468+ sink.end(time, value);
469+}
470+
471+var defaultScheduler = new Scheduler(new ClockTimer(), new Timeline());
472+
473+var scheduleTasks = curry2(function (tasks, scheduler) {
474+ var scheduledTasks = tasks.map(function (task) { return scheduler.asap(task); });
475+
476+ return {
477+ dispose: function () { return scheduledTasks.forEach(function (task) { return task.dispose(); }); }
478+ }
479+});
480+
481+var Stream = function Stream (source) {
482+ this.source = source;
483+};
484+
485+var tapEnd = curry2(function (f, stream) { return new Stream(new TapEnd(f, stream.source)); });
486+
487+var tapEvent = curry2(function (f, stream) { return new Stream(new TapEvent(f, stream.source)); });
488+
489+var TapEvent = function TapEvent (f, source) {
490+ this.source = source;
491+ this.f = f;
492+
493+ this.run = function (sink) { return function (scheduler) { return source.run(new TapSink(f, sink))(scheduler); }; };
494+};
495+
496+var TapSink = function TapSink (f, sink) {
497+ this.event = function (t) { return function (x) {
498+ f(x)();
499+ sink.event(t)(x);
500+ }; };
501+
502+ this.end = function (t) {
503+ sink.end(t);
504+ };
505+};
506+
507+var TapEnd = function TapEnd (f, source) {
508+ this.source = source;
509+ this.f = f;
510+
511+ this.run = function (sink) { return function (scheduler) { return source.run(new TapEndSink(f, sink))(scheduler); }; };
512+};
513+
514+var TapEndSink = function TapEndSink (f, sink) {
515+ this.event = function (t) { return function (x) { return sink.event(t)(x); }; };
516+
517+ this.end = function (t) {
518+ f();
519+ sink.end(t);
520+ };
521+};
522+
523+var SettableDisposable = function SettableDisposable () {
524+ this.disposable = void 0;
525+ this.disposed = false;
526+ this.result = void 0;
527+};
528+
529+SettableDisposable.prototype.setDisposable = function setDisposable (disposable) {
530+ this.disposable = disposable;
531+
532+ if (this.disposed) {
533+ this.result = disposable.dispose();
534+ }
535+};
536+
537+SettableDisposable.prototype.dispose = function dispose () {
538+ if (this.disposed) {
539+ return this.result
540+ }
541+
542+ this.disposed = true;
543+
544+ if (this.disposable !== void 0) {
545+ this.result = this.disposable.dispose();
546+ }
547+
548+ return this.result
549+};
550+
551+function runEffects (stream, scheduler) {
552+ return runSourceEffects(stream.source, scheduler)
553+}
554+
555+var runSourceEffects = function (source, scheduler) { return runSource(source, scheduler); };
556+
557+function runSource (source, scheduler) {
558+ var disposable = new SettableDisposable();
559+ var observer = new RunEffectsSink(disposable);
560+
561+ disposable.setDisposable(source.run(observer)(scheduler));
562+}
563+
564+var RunEffectsSink = function RunEffectsSink (disposable) {
565+ this._disposable = disposable;
566+ this.active = true;
567+};
568+
569+RunEffectsSink.prototype.event = function event (t) {
570+ return function (x) {}
571+};
572+
573+RunEffectsSink.prototype.end = function end (t) {
574+ this.active = false;
575+ Promise.resolve(this._disposable).then(function (d) { return d.dispose(); });
576+};
577+
578+var drain = function (stream) { return function () { return runEffects(stream, defaultScheduler); }; };
579+
580+var combine =
581+ curry3(function (f, stream1, stream2) { return new Stream(new Combine(f, stream1.source, stream2.source)); });
582+
583+var Combine = function Combine (f, source1, source2) {
584+ this.f = f;
585+ this.source1 = source1;
586+ this.source2 = source2;
587+};
588+
589+Combine.prototype.run = function run (sink) {
590+ var this$1 = this;
591+
592+ return function (scheduler) {
593+ var disposables = Array(2);
594+ var sinks = Array(2);
595+
596+ var mergeSink = new CombineSink(disposables, sinks, sink, this$1.f);
597+
598+ sinks[0] = new IndexSink(0, mergeSink);
599+ sinks[1] = new IndexSink(1, mergeSink);
600+ disposables[0] = this$1.source1.run(sinks[0])(scheduler);
601+ disposables[1] = this$1.source2.run(sinks[1])(scheduler);
602+
603+ return disposeAll(disposables)
604+ }
605+};
606+
607+var IndexSink = function IndexSink () {};
608+
609+IndexSink.prototype.cosntructor = function cosntructor (i, sink) {
610+ this.i = i;
611+ this.sink = sink;
612+};
613+
614+IndexSink.prototype.event = function event (t) {
615+ var this$1 = this;
616+
617+ return function (x) {
618+ this$1.sink.event(t)({ index: this$1.i, value: x });
619+ }
620+};
621+
622+IndexSink.prototype.end = function end (t) {
623+ this.sink.end(t, this.i);
624+};
625+
626+var CombineSink = function CombineSink (disposables, sinks, sink, f) {
627+ this.disposables = disposables;
628+ this.sinks = sinks;
629+ this.sink = sink;
630+ this.f = f;
631+
632+ this.awaiting = 2;
633+ this.values = Array(2);
634+ this.hasValue = [false, false];
635+ this.activeCount = 2;
636+};
637+
638+CombineSink.prototype.event = function event (t) {
639+ var this$1 = this;
640+
641+ return function (ref) {
642+ var index = ref.index;
643+ var value = ref.value;
644+
645+ var f = this$1.f;
646+ var awaiting = this$1._updateReady(index);
647+ this$1.values[index] = value;
648+
649+ if (awaiting === 0) {
650+ var result = f(this$1.values[0])(this$1.values[1]);
651+ this$1.sink.event(t)(result);
652+ }
653+ }
654+};
655+
656+CombineSink.prototype._updateReady = function _updateReady (index) {
657+ if (this.awaiting > 0) {
658+ if (!this.hasValue[index]) {
659+ this.hasValue[index] = true;
660+ this.awaiting -= 1;
661+ }
662+ }
663+
664+ return this.awaiting
665+};
666+
667+CombineSink.prototype.end = function end (t, ref) {
668+ var index = ref.index;
669+ var value = ref.value;
670+
671+ this.disposables[index].dispose();
672+
673+ if (--this.activeCount === 0) { this.sink.end(t); }
674+};
675+
676+/* */
677+
678+exports.createDisposable = createDisposable;
679+exports.emptyDisposable = emptyDisposable;
680+exports.disposeAll = disposeAll;
681+exports.defaultScheduler = defaultScheduler;
682+exports.scheduleTasks = scheduleTasks;
683+exports.endTask = endTask;
684+exports.eventTask = eventTask;
685+exports.tapEnd = tapEnd;
686+exports.tapEvent = tapEvent;
687+exports.drain = drain;
688+exports.combine = combine;
src/Control/Stream.pursnew file+130
@@ -0,0 +1,130 @@
1+module Control.Stream
2+ ( STREAM
3+ , EffStream
4+ , PureStream
5+ , Stream
6+ , Source
7+ , Sink
8+ , Scheduler
9+ , Task
10+ , ScheduledTask
11+ , Disposable
12+ , Time
13+ , createStream
14+ , getSource
15+ , runSource
16+ , defaultScheduler
17+ , eventTask
18+ , endTask
19+ , createDisposable
20+ , emptyDisposable
21+ , disposeAll
22+ , scheduleTasks
23+ , drain
24+ , tapEvent
25+ , tapEnd
26+ , just
27+ , fromArray
28+ )
29+ where
30+
31+import Control.Monad.Eff (Eff, Pure)
32+import Data.Array (snoc)
33+import Data.Functor (class Functor, map)
34+import Data.Unit (Unit)
35+import Prelude (flip)
36+
37+newtype Time = Time Int
38+
39+foreign import data STREAM :: !
40+
41+type EffStream e a = Eff (stream :: STREAM | e) a
42+type PureStream a = EffStream () a
43+
44+newtype Stream a = Stream { source :: Source a }
45+
46+type Source a = { run :: Sink a -> Scheduler -> Disposable }
47+
48+type Sink a =
49+ { event :: Time -> a -> Unit
50+ , end :: Time -> Unit
51+ }
52+
53+type Scheduler =
54+ { now :: Pure Time
55+ , asap :: Task -> ScheduledTask
56+ , delay :: Number -> Task -> ScheduledTask
57+ , period :: Number -> Task -> ScheduledTask
58+ , schedule :: Number -> Number -> Task -> ScheduledTask
59+ , cancel :: ScheduledTask -> Unit
60+ , cancelAll :: (ScheduledTask -> Boolean) -> Unit
61+ }
62+
63+type Task =
64+ { run :: Time -> Unit
65+ , dispose :: Pure Unit
66+ }
67+
68+type ScheduledTask =
69+ { run :: Pure Unit
70+ , dispose :: Pure Unit
71+ }
72+
73+type Disposable = { dispose :: Pure Unit }
74+
75+instance functorStream :: Functor Stream where
76+ map = _map
77+
78+createStream :: forall a. (Sink a -> Scheduler -> Disposable) -> Stream a
79+createStream run = Stream { source: { run } }
80+
81+getSource :: forall a. Stream a -> Source a
82+getSource stream = case stream of Stream a -> a.source
83+
84+runSource :: forall a. Stream a -> Sink a -> Scheduler -> Disposable
85+runSource stream sink scheduler = (getSource stream).run sink scheduler
86+
87+just :: forall a. a -> Stream a
88+just a = createStream (runJust a)
89+
90+runJust :: forall a. a -> Sink a -> Scheduler -> Disposable
91+runJust a sink scheduler =
92+ scheduleTasks [ eventTask a sink, endTask sink ] scheduler
93+
94+-- TODO: remove fromArray because it's not a real event stream
95+-- replace with a fromArray combinator
96+fromArray :: forall a. Array a -> Stream a
97+fromArray arr = createStream (runFromArray arr)
98+
99+runFromArray :: forall a. Array a -> Sink a -> Scheduler -> Disposable
100+runFromArray arr sink scheduler = scheduleTasks tasks scheduler
101+ where
102+ tasks :: Array Task
103+ tasks = snoc eventTasks (endTask sink)
104+
105+ eventTasks :: Array Task
106+ eventTasks = map (flip eventTask sink) arr
107+
108+_map :: forall a b. (a -> b) -> Stream a -> Stream b
109+_map f stream = createStream runMap
110+ where
111+ runMap :: Sink b -> Scheduler -> Disposable
112+ runMap sink scheduler =
113+ runSource stream (mapSink f sink) scheduler
114+
115+mapSink :: forall a b. (a -> b) -> Sink b -> Sink a
116+mapSink f sink = { event: mapEvent, end: sink.end }
117+ where
118+ mapEvent :: Time -> a -> Unit
119+ mapEvent time value = sink.event time (f value)
120+
121+foreign import defaultScheduler :: Scheduler
122+foreign import eventTask :: forall a. a -> Sink a -> Task
123+foreign import endTask :: forall a. Sink a -> Task
124+foreign import createDisposable :: forall a. (a -> Unit) -> a -> Disposable
125+foreign import emptyDisposable :: Disposable
126+foreign import disposeAll :: Array Disposable -> Disposable
127+foreign import scheduleTasks :: Array Task -> Scheduler -> Disposable
128+foreign import drain :: forall e a. Stream a -> EffStream e Unit
129+foreign import tapEvent :: forall e a. (a -> EffStream e Unit) -> Stream a -> Stream a
130+foreign import tapEnd :: forall e a. EffStream e Unit -> Stream a -> Stream a
yarn.locknew file+1033
@@ -0,0 +1,1033 @@
1+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+# yarn lockfile v1
3+
4+
5+"@most/eslint-config-most@^1.0.3":
6+ version "1.0.3"
7+ resolved "https://registry.yarnpkg.com/@most/eslint-config-most/-/eslint-config-most-1.0.3.tgz#eeca9e18d9efe87151a6e7f4d12beb97b585cd20"
8+ dependencies:
9+ eslint-config-standard "^5.3.5"
10+ eslint-plugin-promise "^2.0.0"
11+ eslint-plugin-standard "^2.0.0"
12+
13+"@most/prelude@^1.5.0":
14+ version "1.5.0"
15+ resolved "https://registry.yarnpkg.com/@most/prelude/-/prelude-1.5.0.tgz#0c8ce09f305039d4055d3deb59c9e44cd337854d"
16+
17+acorn-jsx@^3.0.0, acorn-jsx@^3.0.1:
18+ version "3.0.1"
19+ resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
20+ dependencies:
21+ acorn "^3.0.4"
22+
23+acorn-object-spread@^1.0.0:
24+ version "1.0.0"
25+ resolved "https://registry.yarnpkg.com/acorn-object-spread/-/acorn-object-spread-1.0.0.tgz#48ead0f4a8eb16995a17a0db9ffc6acaada4ba68"
26+ dependencies:
27+ acorn "^3.1.0"
28+
29+acorn@4.0.4:
30+ version "4.0.4"
31+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a"
32+
33+acorn@^3.0.4, acorn@^3.1.0, acorn@^3.3.0:
34+ version "3.3.0"
35+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
36+
37+ajv-keywords@^1.0.0:
38+ version "1.5.1"
39+ resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
40+
41+ajv@^4.7.0:
42+ version "4.11.4"
43+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.4.tgz#ebf3a55d4b132ea60ff5847ae85d2ef069960b45"
44+ dependencies:
45+ co "^4.6.0"
46+ json-stable-stringify "^1.0.1"
47+
48+align-text@^0.1.1, align-text@^0.1.3:
49+ version "0.1.4"
50+ resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
51+ dependencies:
52+ kind-of "^3.0.2"
53+ longest "^1.0.1"
54+ repeat-string "^1.5.2"
55+
56+ansi-escapes@^1.1.0:
57+ version "1.4.0"
58+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
59+
60+ansi-regex@^2.0.0:
61+ version "2.1.1"
62+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
63+
64+ansi-styles@^2.2.1:
65+ version "2.2.1"
66+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
67+
68+argparse@^1.0.7:
69+ version "1.0.9"
70+ resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
71+ dependencies:
72+ sprintf-js "~1.0.2"
73+
74+array-union@^1.0.1:
75+ version "1.0.2"
76+ resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
77+ dependencies:
78+ array-uniq "^1.0.1"
79+
80+array-uniq@^1.0.1:
81+ version "1.0.3"
82+ resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
83+
84+arrify@^1.0.0:
85+ version "1.0.1"
86+ resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
87+
88+babel-code-frame@^6.16.0:
89+ version "6.22.0"
90+ resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
91+ dependencies:
92+ chalk "^1.1.0"
93+ esutils "^2.0.2"
94+ js-tokens "^3.0.0"
95+
96+babylon@^6.15.0:
97+ version "6.16.1"
98+ resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"
99+
100+balanced-match@^0.4.1:
101+ version "0.4.2"
102+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
103+
104+brace-expansion@^1.0.0:
105+ version "1.1.6"
106+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
107+ dependencies:
108+ balanced-match "^0.4.1"
109+ concat-map "0.0.1"
110+
111+browser-resolve@^1.11.0:
112+ version "1.11.2"
113+ resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
114+ dependencies:
115+ resolve "1.1.7"
116+
117+buble@^0.15.0:
118+ version "0.15.2"
119+ resolved "https://registry.yarnpkg.com/buble/-/buble-0.15.2.tgz#547fc47483f8e5e8176d82aa5ebccb183b02d613"
120+ dependencies:
121+ acorn "^3.3.0"
122+ acorn-jsx "^3.0.1"
123+ acorn-object-spread "^1.0.0"
124+ chalk "^1.1.3"
125+ magic-string "^0.14.0"
126+ minimist "^1.2.0"
127+ os-homedir "^1.0.1"
128+
129+buffer-shims@^1.0.0:
130+ version "1.0.0"
131+ resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
132+
133+builtin-modules@^1.1.0:
134+ version "1.1.1"
135+ resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
136+
137+caller-path@^0.1.0:
138+ version "0.1.0"
139+ resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
140+ dependencies:
141+ callsites "^0.2.0"
142+
143+callsites@^0.2.0:
144+ version "0.2.0"
145+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
146+
147+camelcase@^1.0.2:
148+ version "1.2.1"
149+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
150+
151+center-align@^0.1.1:
152+ version "0.1.3"
153+ resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
154+ dependencies:
155+ align-text "^0.1.3"
156+ lazy-cache "^1.0.3"
157+
158+chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
159+ version "1.1.3"
160+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
161+ dependencies:
162+ ansi-styles "^2.2.1"
163+ escape-string-regexp "^1.0.2"
164+ has-ansi "^2.0.0"
165+ strip-ansi "^3.0.0"
166+ supports-color "^2.0.0"
167+
168+circular-json@^0.3.1:
169+ version "0.3.1"
170+ resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d"
171+
172+cli-cursor@^1.0.1:
173+ version "1.0.2"
174+ resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"
175+ dependencies:
176+ restore-cursor "^1.0.1"
177+
178+cli-width@^2.0.0:
179+ version "2.1.0"
180+ resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a"
181+
182+cliui@^2.1.0:
183+ version "2.1.0"
184+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
185+ dependencies:
186+ center-align "^0.1.1"
187+ right-align "^0.1.1"
188+ wordwrap "0.0.2"
189+
190+co@^4.6.0:
191+ version "4.6.0"
192+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
193+
194+code-point-at@^1.0.0:
195+ version "1.1.0"
196+ resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
197+
198+concat-map@0.0.1:
199+ version "0.0.1"
200+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
201+
202+concat-stream@^1.4.6:
203+ version "1.6.0"
204+ resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"
205+ dependencies:
206+ inherits "^2.0.3"
207+ readable-stream "^2.2.2"
208+ typedarray "^0.0.6"
209+
210+core-util-is@~1.0.0:
211+ version "1.0.2"
212+ resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
213+
214+d@^0.1.1, d@~0.1.1:
215+ version "0.1.1"
216+ resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309"
217+ dependencies:
218+ es5-ext "~0.10.2"
219+
220+debug@^2.1.1:
221+ version "2.6.1"
222+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351"
223+ dependencies:
224+ ms "0.7.2"
225+
226+decamelize@^1.0.0:
227+ version "1.2.0"
228+ resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
229+
230+deep-is@~0.1.3:
231+ version "0.1.3"
232+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
233+
234+del@^2.0.2:
235+ version "2.2.2"
236+ resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
237+ dependencies:
238+ globby "^5.0.0"
239+ is-path-cwd "^1.0.0"
240+ is-path-in-cwd "^1.0.0"
241+ object-assign "^4.0.1"
242+ pify "^2.0.0"
243+ pinkie-promise "^2.0.0"
244+ rimraf "^2.2.8"
245+
246+doctrine@^1.2.2:
247+ version "1.5.0"
248+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa"
249+ dependencies:
250+ esutils "^2.0.2"
251+ isarray "^1.0.0"
252+
253+es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7:
254+ version "0.10.12"
255+ resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047"
256+ dependencies:
257+ es6-iterator "2"
258+ es6-symbol "~3.1"
259+
260+es6-iterator@2:
261+ version "2.0.0"
262+ resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac"
263+ dependencies:
264+ d "^0.1.1"
265+ es5-ext "^0.10.7"
266+ es6-symbol "3"
267+
268+es6-map@^0.1.3:
269+ version "0.1.4"
270+ resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897"
271+ dependencies:
272+ d "~0.1.1"
273+ es5-ext "~0.10.11"
274+ es6-iterator "2"
275+ es6-set "~0.1.3"
276+ es6-symbol "~3.1.0"
277+ event-emitter "~0.3.4"
278+
279+es6-set@~0.1.3:
280+ version "0.1.4"
281+ resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8"
282+ dependencies:
283+ d "~0.1.1"
284+ es5-ext "~0.10.11"
285+ es6-iterator "2"
286+ es6-symbol "3"
287+ event-emitter "~0.3.4"
288+
289+es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0:
290+ version "3.1.0"
291+ resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa"
292+ dependencies:
293+ d "~0.1.1"
294+ es5-ext "~0.10.11"
295+
296+es6-weak-map@^2.0.1:
297+ version "2.0.1"
298+ resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81"
299+ dependencies:
300+ d "^0.1.1"
301+ es5-ext "^0.10.8"
302+ es6-iterator "2"
303+ es6-symbol "3"
304+
305+escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
306+ version "1.0.5"
307+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
308+
309+escope@^3.6.0:
310+ version "3.6.0"
311+ resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3"
312+ dependencies:
313+ es6-map "^0.1.3"
314+ es6-weak-map "^2.0.1"
315+ esrecurse "^4.1.0"
316+ estraverse "^4.1.1"
317+
318+eslint-config-standard@^5.3.5:
319+ version "5.3.5"
320+ resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-5.3.5.tgz#2b42bb5c9f0049b8527868e109c34ee22b13dcf6"
321+
322+eslint-config-standard@^7.0.1:
323+ version "7.0.1"
324+ resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-7.0.1.tgz#6cec96084de9ac862c33ccb953d13a7c59872342"
325+
326+eslint-plugin-promise@^2.0.0:
327+ version "2.0.1"
328+ resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-2.0.1.tgz#a9759cefa5e38ab11bb2ef65a04ef042309aa0a4"
329+
330+eslint-plugin-promise@^3.5.0:
331+ version "3.5.0"
332+ resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca"
333+
334+eslint-plugin-standard@^2.0.0, eslint-plugin-standard@^2.1.1:
335+ version "2.1.1"
336+ resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-2.1.1.tgz#97960b1537e1718bb633877d0a650050effff3b0"
337+
338+eslint@^3.17.1:
339+ version "3.17.1"
340+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.17.1.tgz#b80ae12d9c406d858406fccda627afce33ea10ea"
341+ dependencies:
342+ babel-code-frame "^6.16.0"
343+ chalk "^1.1.3"
344+ concat-stream "^1.4.6"
345+ debug "^2.1.1"
346+ doctrine "^1.2.2"
347+ escope "^3.6.0"
348+ espree "^3.4.0"
349+ estraverse "^4.2.0"
350+ esutils "^2.0.2"
351+ file-entry-cache "^2.0.0"
352+ glob "^7.0.3"
353+ globals "^9.14.0"
354+ ignore "^3.2.0"
355+ imurmurhash "^0.1.4"
356+ inquirer "^0.12.0"
357+ is-my-json-valid "^2.10.0"
358+ is-resolvable "^1.0.0"
359+ js-yaml "^3.5.1"
360+ json-stable-stringify "^1.0.0"
361+ levn "^0.3.0"
362+ lodash "^4.0.0"
363+ mkdirp "^0.5.0"
364+ natural-compare "^1.4.0"
365+ optionator "^0.8.2"
366+ path-is-inside "^1.0.1"
367+ pluralize "^1.2.1"
368+ progress "^1.1.8"
369+ require-uncached "^1.0.2"
370+ shelljs "^0.7.5"
371+ strip-bom "^3.0.0"
372+ strip-json-comments "~2.0.1"
373+ table "^3.7.8"
374+ text-table "~0.2.0"
375+ user-home "^2.0.0"
376+
377+espree@^3.4.0:
378+ version "3.4.0"
379+ resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d"
380+ dependencies:
381+ acorn "4.0.4"
382+ acorn-jsx "^3.0.0"
383+
384+esprima@^3.1.1:
385+ version "3.1.3"
386+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
387+
388+esrecurse@^4.1.0:
389+ version "4.1.0"
390+ resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220"
391+ dependencies:
392+ estraverse "~4.1.0"
393+ object-assign "^4.0.1"
394+
395+estraverse@^4.1.1, estraverse@^4.2.0:
396+ version "4.2.0"
397+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
398+
399+estraverse@~4.1.0:
400+ version "4.1.1"
401+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2"
402+
403+estree-walker@^0.2.1:
404+ version "0.2.1"
405+ resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e"
406+
407+esutils@^2.0.2:
408+ version "2.0.2"
409+ resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
410+
411+event-emitter@~0.3.4:
412+ version "0.3.4"
413+ resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5"
414+ dependencies:
415+ d "~0.1.1"
416+ es5-ext "~0.10.7"
417+
418+exit-hook@^1.0.0:
419+ version "1.1.1"
420+ resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8"
421+
422+fast-levenshtein@~2.0.4:
423+ version "2.0.6"
424+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
425+
426+figures@^1.3.5:
427+ version "1.7.0"
428+ resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
429+ dependencies:
430+ escape-string-regexp "^1.0.5"
431+ object-assign "^4.1.0"
432+
433+file-entry-cache@^2.0.0:
434+ version "2.0.0"
435+ resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
436+ dependencies:
437+ flat-cache "^1.2.1"
438+ object-assign "^4.0.1"
439+
440+flat-cache@^1.2.1:
441+ version "1.2.2"
442+ resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96"
443+ dependencies:
444+ circular-json "^0.3.1"
445+ del "^2.0.2"
446+ graceful-fs "^4.1.2"
447+ write "^0.2.1"
448+
449+flow-remove-types@^1.1.0:
450+ version "1.2.0"
451+ resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-1.2.0.tgz#c285516eabba72177a1b10bfb58f6ffb675a8877"
452+ dependencies:
453+ babylon "^6.15.0"
454+ vlq "^0.2.1"
455+
456+fs.realpath@^1.0.0:
457+ version "1.0.0"
458+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
459+
460+generate-function@^2.0.0:
461+ version "2.0.0"
462+ resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
463+
464+generate-object-property@^1.1.0:
465+ version "1.2.0"
466+ resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
467+ dependencies:
468+ is-property "^1.0.0"
469+
470+glob@^7.0.0, glob@^7.0.3, glob@^7.0.5:
471+ version "7.1.1"
472+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
473+ dependencies:
474+ fs.realpath "^1.0.0"
475+ inflight "^1.0.4"
476+ inherits "2"
477+ minimatch "^3.0.2"
478+ once "^1.3.0"
479+ path-is-absolute "^1.0.0"
480+
481+globals@^9.14.0:
482+ version "9.16.0"
483+ resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80"
484+
485+globby@^5.0.0:
486+ version "5.0.0"
487+ resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d"
488+ dependencies:
489+ array-union "^1.0.1"
490+ arrify "^1.0.0"
491+ glob "^7.0.3"
492+ object-assign "^4.0.1"
493+ pify "^2.0.0"
494+ pinkie-promise "^2.0.0"
495+
496+graceful-fs@^4.1.2:
497+ version "4.1.11"
498+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
499+
500+has-ansi@^2.0.0:
501+ version "2.0.0"
502+ resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
503+ dependencies:
504+ ansi-regex "^2.0.0"
505+
506+ignore@^3.2.0:
507+ version "3.2.4"
508+ resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8"
509+
510+imurmurhash@^0.1.4:
511+ version "0.1.4"
512+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
513+
514+inflight@^1.0.4:
515+ version "1.0.6"
516+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
517+ dependencies:
518+ once "^1.3.0"
519+ wrappy "1"
520+
521+inherits@2, inherits@^2.0.3, inherits@~2.0.1:
522+ version "2.0.3"
523+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
524+
525+inquirer@^0.12.0:
526+ version "0.12.0"
527+ resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e"
528+ dependencies:
529+ ansi-escapes "^1.1.0"
530+ ansi-regex "^2.0.0"
531+ chalk "^1.0.0"
532+ cli-cursor "^1.0.1"
533+ cli-width "^2.0.0"
534+ figures "^1.3.5"
535+ lodash "^4.3.0"
536+ readline2 "^1.0.1"
537+ run-async "^0.1.0"
538+ rx-lite "^3.1.2"
539+ string-width "^1.0.1"
540+ strip-ansi "^3.0.0"
541+ through "^2.3.6"
542+
543+interpret@^1.0.0:
544+ version "1.0.1"
545+ resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
546+
547+is-buffer@^1.0.2:
548+ version "1.1.4"
549+ resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b"
550+
551+is-fullwidth-code-point@^1.0.0:
552+ version "1.0.0"
553+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
554+ dependencies:
555+ number-is-nan "^1.0.0"
556+
557+is-fullwidth-code-point@^2.0.0:
558+ version "2.0.0"
559+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
560+
561+is-my-json-valid@^2.10.0:
562+ version "2.16.0"
563+ resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693"
564+ dependencies:
565+ generate-function "^2.0.0"
566+ generate-object-property "^1.1.0"
567+ jsonpointer "^4.0.0"
568+ xtend "^4.0.0"
569+
570+is-path-cwd@^1.0.0:
571+ version "1.0.0"
572+ resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
573+
574+is-path-in-cwd@^1.0.0:
575+ version "1.0.0"
576+ resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc"
577+ dependencies:
578+ is-path-inside "^1.0.0"
579+
580+is-path-inside@^1.0.0:
581+ version "1.0.0"
582+ resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f"
583+ dependencies:
584+ path-is-inside "^1.0.1"
585+
586+is-property@^1.0.0:
587+ version "1.0.2"
588+ resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
589+
590+is-resolvable@^1.0.0:
591+ version "1.0.0"
592+ resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62"
593+ dependencies:
594+ tryit "^1.0.1"
595+
596+isarray@^1.0.0, isarray@~1.0.0:
597+ version "1.0.0"
598+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
599+
600+js-tokens@^3.0.0:
601+ version "3.0.1"
602+ resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7"
603+
604+js-yaml@^3.5.1:
605+ version "3.8.2"
606+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721"
607+ dependencies:
608+ argparse "^1.0.7"
609+ esprima "^3.1.1"
610+
611+json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:
612+ version "1.0.1"
613+ resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
614+ dependencies:
615+ jsonify "~0.0.0"
616+
617+jsonify@~0.0.0:
618+ version "0.0.0"
619+ resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
620+
621+jsonpointer@^4.0.0:
622+ version "4.0.1"
623+ resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
624+
625+kind-of@^3.0.2:
626+ version "3.1.0"
627+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47"
628+ dependencies:
629+ is-buffer "^1.0.2"
630+
631+lazy-cache@^1.0.3:
632+ version "1.0.4"
633+ resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
634+
635+levn@^0.3.0, levn@~0.3.0:
636+ version "0.3.0"
637+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
638+ dependencies:
639+ prelude-ls "~1.1.2"
640+ type-check "~0.3.2"
641+
642+lodash@^4.0.0, lodash@^4.3.0:
643+ version "4.17.4"
644+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
645+
646+longest@^1.0.1:
647+ version "1.0.1"
648+ resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
649+
650+magic-string@^0.14.0:
651+ version "0.14.0"
652+ resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.14.0.tgz#57224aef1701caeed273b17a39a956e72b172462"
653+ dependencies:
654+ vlq "^0.2.1"
655+
656+minimatch@^3.0.2:
657+ version "3.0.3"
658+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
659+ dependencies:
660+ brace-expansion "^1.0.0"
661+
662+minimist@0.0.8:
663+ version "0.0.8"
664+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
665+
666+minimist@^1.2.0:
667+ version "1.2.0"
668+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
669+
670+mkdirp@^0.5.0, mkdirp@^0.5.1:
671+ version "0.5.1"
672+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
673+ dependencies:
674+ minimist "0.0.8"
675+
676+ms@0.7.2:
677+ version "0.7.2"
678+ resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765"
679+
680+mute-stream@0.0.5:
681+ version "0.0.5"
682+ resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
683+
684+natural-compare@^1.4.0:
685+ version "1.4.0"
686+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
687+
688+number-is-nan@^1.0.0:
689+ version "1.0.1"
690+ resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
691+
692+object-assign@^4.0.1, object-assign@^4.1.0:
693+ version "4.1.1"
694+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
695+
696+once@^1.3.0:
697+ version "1.4.0"
698+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
699+ dependencies:
700+ wrappy "1"
701+
702+onetime@^1.0.0:
703+ version "1.1.0"
704+ resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789"
705+
706+optionator@^0.8.2:
707+ version "0.8.2"
708+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
709+ dependencies:
710+ deep-is "~0.1.3"
711+ fast-levenshtein "~2.0.4"
712+ levn "~0.3.0"
713+ prelude-ls "~1.1.2"
714+ type-check "~0.3.2"
715+ wordwrap "~1.0.0"
716+
717+os-homedir@^1.0.0, os-homedir@^1.0.1:
718+ version "1.0.2"
719+ resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
720+
721+path-is-absolute@^1.0.0:
722+ version "1.0.1"
723+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
724+
725+path-is-inside@^1.0.1:
726+ version "1.0.2"
727+ resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
728+
729+path-parse@^1.0.5:
730+ version "1.0.5"
731+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
732+
733+pify@^2.0.0:
734+ version "2.3.0"
735+ resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
736+
737+pinkie-promise@^2.0.0:
738+ version "2.0.1"
739+ resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
740+ dependencies:
741+ pinkie "^2.0.0"
742+
743+pinkie@^2.0.0:
744+ version "2.0.4"
745+ resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
746+
747+pluralize@^1.2.1:
748+ version "1.2.1"
749+ resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45"
750+
751+prelude-ls@~1.1.2:
752+ version "1.1.2"
753+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
754+
755+process-nextick-args@~1.0.6:
756+ version "1.0.7"
757+ resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
758+
759+progress@^1.1.8:
760+ version "1.1.8"
761+ resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
762+
763+readable-stream@^2.2.2:
764+ version "2.2.3"
765+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
766+ dependencies:
767+ buffer-shims "^1.0.0"
768+ core-util-is "~1.0.0"
769+ inherits "~2.0.1"
770+ isarray "~1.0.0"
771+ process-nextick-args "~1.0.6"
772+ string_decoder "~0.10.x"
773+ util-deprecate "~1.0.1"
774+
775+readline2@^1.0.1:
776+ version "1.0.1"
777+ resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35"
778+ dependencies:
779+ code-point-at "^1.0.0"
780+ is-fullwidth-code-point "^1.0.0"
781+ mute-stream "0.0.5"
782+
783+rechoir@^0.6.2:
784+ version "0.6.2"
785+ resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
786+ dependencies:
787+ resolve "^1.1.6"
788+
789+repeat-string@^1.5.2:
790+ version "1.6.1"
791+ resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
792+
793+require-uncached@^1.0.2:
794+ version "1.0.3"
795+ resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
796+ dependencies:
797+ caller-path "^0.1.0"
798+ resolve-from "^1.0.0"
799+
800+resolve-from@^1.0.0:
801+ version "1.0.1"
802+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
803+
804+resolve@1.1.7:
805+ version "1.1.7"
806+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
807+
808+resolve@^1.1.6:
809+ version "1.3.2"
810+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235"
811+ dependencies:
812+ path-parse "^1.0.5"
813+
814+restore-cursor@^1.0.1:
815+ version "1.0.1"
816+ resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
817+ dependencies:
818+ exit-hook "^1.0.0"
819+ onetime "^1.0.0"
820+
821+right-align@^0.1.1:
822+ version "0.1.3"
823+ resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
824+ dependencies:
825+ align-text "^0.1.1"
826+
827+rimraf@^2.2.8:
828+ version "2.6.1"
829+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d"
830+ dependencies:
831+ glob "^7.0.5"
832+
833+rollup-plugin-buble@^0.15.0:
834+ version "0.15.0"
835+ resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.15.0.tgz#83c3e89c7fd2266c7918f41ba3980313519c7fd0"
836+ dependencies:
837+ buble "^0.15.0"
838+ rollup-pluginutils "^1.5.0"
839+
840+rollup-plugin-flow@^1.1.1:
841+ version "1.1.1"
842+ resolved "https://registry.yarnpkg.com/rollup-plugin-flow/-/rollup-plugin-flow-1.1.1.tgz#6ce568f1dd559666b77ab76b4bae251407528db6"
843+ dependencies:
844+ flow-remove-types "^1.1.0"
845+ rollup-pluginutils "^1.5.1"
846+
847+rollup-plugin-node-resolve@^2.0.0:
848+ version "2.0.0"
849+ resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.0.0.tgz#07e0ae94ac002a3ea36e8f33ca121d9f836b1309"
850+ dependencies:
851+ browser-resolve "^1.11.0"
852+ builtin-modules "^1.1.0"
853+ resolve "^1.1.6"
854+
855+rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.1:
856+ version "1.5.2"
857+ resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
858+ dependencies:
859+ estree-walker "^0.2.1"
860+ minimatch "^3.0.2"
861+
862+rollup@^0.41.4:
863+ version "0.41.4"
864+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8"
865+ dependencies:
866+ source-map-support "^0.4.0"
867+
868+run-async@^0.1.0:
869+ version "0.1.0"
870+ resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389"
871+ dependencies:
872+ once "^1.3.0"
873+
874+rx-lite@^3.1.2:
875+ version "3.1.2"
876+ resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102"
877+
878+shelljs@^0.7.5:
879+ version "0.7.6"
880+ resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
881+ dependencies:
882+ glob "^7.0.0"
883+ interpret "^1.0.0"
884+ rechoir "^0.6.2"
885+
886+slice-ansi@0.0.4:
887+ version "0.0.4"
888+ resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
889+
890+source-map-support@^0.4.0:
891+ version "0.4.11"
892+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322"
893+ dependencies:
894+ source-map "^0.5.3"
895+
896+source-map@^0.5.3, source-map@~0.5.1:
897+ version "0.5.6"
898+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
899+
900+sprintf-js@~1.0.2:
901+ version "1.0.3"
902+ resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
903+
904+string-width@^1.0.1:
905+ version "1.0.2"
906+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
907+ dependencies:
908+ code-point-at "^1.0.0"
909+ is-fullwidth-code-point "^1.0.0"
910+ strip-ansi "^3.0.0"
911+
912+string-width@^2.0.0:
913+ version "2.0.0"
914+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e"
915+ dependencies:
916+ is-fullwidth-code-point "^2.0.0"
917+ strip-ansi "^3.0.0"
918+
919+string_decoder@~0.10.x:
920+ version "0.10.31"
921+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
922+
923+strip-ansi@^3.0.0:
924+ version "3.0.1"
925+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
926+ dependencies:
927+ ansi-regex "^2.0.0"
928+
929+strip-bom@^3.0.0:
930+ version "3.0.0"
931+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
932+
933+strip-json-comments@~2.0.1:
934+ version "2.0.1"
935+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
936+
937+supports-color@^2.0.0:
938+ version "2.0.0"
939+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
940+
941+table@^3.7.8:
942+ version "3.8.3"
943+ resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f"
944+ dependencies:
945+ ajv "^4.7.0"
946+ ajv-keywords "^1.0.0"
947+ chalk "^1.1.1"
948+ lodash "^4.0.0"
949+ slice-ansi "0.0.4"
950+ string-width "^2.0.0"
951+
952+text-table@~0.2.0:
953+ version "0.2.0"
954+ resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
955+
956+through@^2.3.6:
957+ version "2.3.8"
958+ resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
959+
960+tryit@^1.0.1:
961+ version "1.0.3"
962+ resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb"
963+
964+type-check@~0.3.2:
965+ version "0.3.2"
966+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
967+ dependencies:
968+ prelude-ls "~1.1.2"
969+
970+typedarray@^0.0.6:
971+ version "0.0.6"
972+ resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
973+
974+uglify-js@^2.8.11:
975+ version "2.8.11"
976+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.11.tgz#11a51c43d810b47bc00aee4d512cb3947ddd1ac4"
977+ dependencies:
978+ source-map "~0.5.1"
979+ uglify-to-browserify "~1.0.0"
980+ yargs "~3.10.0"
981+
982+uglify-to-browserify@~1.0.0:
983+ version "1.0.2"
984+ resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
985+
986+user-home@^2.0.0:
987+ version "2.0.0"
988+ resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f"
989+ dependencies:
990+ os-homedir "^1.0.0"
991+
992+util-deprecate@~1.0.1:
993+ version "1.0.2"
994+ resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
995+
996+vlq@^0.2.1:
997+ version "0.2.1"
998+ resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.1.tgz#14439d711891e682535467f8587c5630e4222a6c"
999+
1000+window-size@0.1.0:
1001+ version "0.1.0"
1002+ resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"
1003+
1004+wordwrap@0.0.2:
1005+ version "0.0.2"
1006+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
1007+
1008+wordwrap@~1.0.0:
1009+ version "1.0.0"
1010+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
1011+
1012+wrappy@1:
1013+ version "1.0.2"
1014+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
1015+
1016+write@^0.2.1:
1017+ version "0.2.1"
1018+ resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
1019+ dependencies:
1020+ mkdirp "^0.5.1"
1021+
1022+xtend@^4.0.0:
1023+ version "4.0.1"
1024+ resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
1025+
1026+yargs@~3.10.0:
1027+ version "3.10.0"
1028+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
1029+ dependencies:
1030+ camelcase "^1.0.2"
1031+ cliui "^2.1.0"
1032+ decamelize "^1.0.0"
1033+ window-size "0.1.0"