@fncts/io 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Channel/api.d.ts +2 -2
- package/Clock/api.d.ts +3 -1
- package/Clock/definition.d.ts +3 -1
- package/Clock/live.d.ts +2 -0
- package/Fiber/api/interruptFork.d.ts +1 -1
- package/IO/api/asyncIO.d.ts +6 -0
- package/IO/api/ensuringChildren.d.ts +7 -0
- package/IO/api/sequenceT.d.ts +2 -3
- package/IO/api/sleep.d.ts +3 -1
- package/IO/api/timeout.d.ts +14 -0
- package/IO/api.d.ts +2 -2
- package/IO/definition.d.ts +8 -4
- package/IO.d.ts +3 -0
- package/IOSpec.d.ts +10 -1
- package/Latch.d.ts +3 -0
- package/Schedule/Decision.d.ts +1 -1
- package/Schedule/api.d.ts +1 -1
- package/Schedule.d.ts +0 -1
- package/Scope/Finalizer/definition.d.ts +1 -1
- package/Scope/ReleaseMap/definition.d.ts +1 -1
- package/Stream/api.d.ts +5 -22
- package/Stream/internal/DebounceState.d.ts +3 -3
- package/Stream/internal/Handoff.d.ts +9 -9
- package/Stream/internal/SinkEndReason.d.ts +6 -18
- package/TFuture/definition.d.ts +1 -1
- package/TSemaphore/definition.d.ts +1 -1
- package/_cjs/Cached.cjs +3 -3
- package/_cjs/Channel/ChildExecutorDecision.cjs +2 -2
- package/_cjs/Channel/UpstreamPullRequest.cjs +2 -2
- package/_cjs/Channel/UpstreamPullStrategy.cjs +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs +1 -1
- package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
- package/_cjs/Channel/api/mapOutIOC.cjs +1 -1
- package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +6 -6
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +14 -14
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/core-api.cjs +1 -1
- package/_cjs/Channel/internal/ChannelExecutor.cjs +2 -2
- package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +8 -7
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/Channel.cjs +3 -3
- package/_cjs/Clock/api.cjs.map +1 -1
- package/_cjs/Clock/live.cjs +1 -1
- package/_cjs/Clock/live.cjs.map +1 -1
- package/_cjs/Clock.cjs +3 -3
- package/_cjs/Console.cjs +3 -3
- package/_cjs/Fiber/FiberContext.cjs +57 -56
- package/_cjs/Fiber/FiberContext.cjs.map +1 -1
- package/_cjs/Fiber/api/interruptFork.cjs +1 -1
- package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
- package/_cjs/Fiber.cjs +23 -23
- package/_cjs/FiberRef/constructors.cjs +1 -1
- package/_cjs/FiberRef/constructors.cjs.map +1 -1
- package/_cjs/FiberRef.cjs +5 -5
- package/_cjs/FiberRefs/join.cjs +2 -2
- package/_cjs/FiberRefs/join.cjs.map +1 -1
- package/_cjs/FiberRefs.cjs +3 -3
- package/_cjs/FiberScope.cjs +2 -2
- package/_cjs/FiberState/constructors.cjs +1 -1
- package/_cjs/FiberState.cjs +3 -3
- package/_cjs/FiberStatus/constructors.cjs +1 -1
- package/_cjs/FiberStatus.cjs +2 -2
- package/_cjs/Future.cjs +3 -3
- package/_cjs/Hub.cjs +2 -2
- package/_cjs/IO/api/asyncIO.cjs +37 -0
- package/_cjs/IO/api/asyncIO.cjs.map +1 -0
- package/_cjs/IO/api/core-scope.cjs +1 -1
- package/_cjs/IO/api/ensuringChildren.cjs +24 -0
- package/_cjs/IO/api/ensuringChildren.cjs.map +1 -0
- package/_cjs/IO/api/interrupt.cjs +5 -5
- package/_cjs/IO/api/interrupt.cjs.map +1 -1
- package/_cjs/IO/api/sleep.cjs.map +1 -1
- package/_cjs/IO/api/timeout.cjs +42 -0
- package/_cjs/IO/api/timeout.cjs.map +1 -0
- package/_cjs/IO/api.cjs +41 -40
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/definition.cjs +9 -6
- package/_cjs/IO/definition.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +1 -1
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IO.cjs +86 -47
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/IOEnv.cjs +3 -3
- package/_cjs/InterruptStatus.cjs +2 -2
- package/_cjs/Layer/api.cjs +5 -3
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Layer.cjs +3 -3
- package/_cjs/Logger.cjs +3 -3
- package/_cjs/Queue/api.cjs +7 -7
- package/_cjs/Queue.cjs +5 -5
- package/_cjs/Random.cjs +3 -3
- package/_cjs/Ref/Atomic/Atomic.cjs +3 -3
- package/_cjs/Ref/Atomic/api.cjs +10 -6
- package/_cjs/Ref/Atomic/api.cjs.map +1 -1
- package/_cjs/Ref/Atomic.cjs +2 -2
- package/_cjs/Ref/Derived.cjs +2 -2
- package/_cjs/Ref/DerivedAll.cjs +1 -1
- package/_cjs/Ref/Synchronized/api.cjs +1 -1
- package/_cjs/Ref/Synchronized/constructors.cjs +1 -1
- package/_cjs/Ref/Synchronized/definition.cjs +1 -1
- package/_cjs/Ref/api/get.cjs +1 -1
- package/_cjs/Ref/api/match.cjs +1 -1
- package/_cjs/Ref/api/matchAll.cjs +1 -1
- package/_cjs/Ref/api/modify.cjs +1 -1
- package/_cjs/Ref/api/set.cjs +1 -1
- package/_cjs/Ref/api.cjs +8 -8
- package/_cjs/Ref/constructors.cjs +1 -1
- package/_cjs/Ref.cjs +9 -9
- package/_cjs/STM/api/core-api.cjs +1 -1
- package/_cjs/STM/api/core-constructors.cjs +1 -1
- package/_cjs/STM/api.cjs +2 -2
- package/_cjs/STM/driver.cjs +1 -1
- package/_cjs/STM/internal/Entry.cjs +1 -1
- package/_cjs/STM/internal/Journal.cjs +2 -2
- package/_cjs/STM.cjs +5 -5
- package/_cjs/Schedule/Decision.cjs.map +1 -1
- package/_cjs/Schedule/api/driver.cjs +11 -9
- package/_cjs/Schedule/api/driver.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +49 -49
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Schedule.cjs +4 -17
- package/_cjs/Schedule.cjs.map +1 -1
- package/_cjs/Scope/Finalizer/definition.cjs +6 -4
- package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
- package/_cjs/Scope/Finalizer.cjs +1 -1
- package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -1
- package/_cjs/Scope/ReleaseMap/api.cjs +1 -1
- package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -1
- package/_cjs/Scope/ReleaseMap/definition.cjs +4 -2
- package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
- package/_cjs/Scope/ReleaseMap.cjs +3 -3
- package/_cjs/Scope/api.cjs +1 -1
- package/_cjs/Scope.cjs +2 -2
- package/_cjs/ScopedRef.cjs +2 -2
- package/_cjs/Sink/api.cjs +1 -1
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/Sink.cjs +2 -2
- package/_cjs/State/api.cjs +2 -2
- package/_cjs/State/definition.cjs +1 -1
- package/_cjs/State.cjs +2 -2
- package/_cjs/Stream/api/zipAllWith.cjs +1 -1
- package/_cjs/Stream/api/zipWith.cjs +1 -1
- package/_cjs/Stream/api.cjs +308 -308
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
- package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
- package/_cjs/Stream/internal/SinkEndReason.cjs +2 -37
- package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
- package/_cjs/Stream.cjs +2 -2
- package/_cjs/Supervisor/constructors.cjs +1 -1
- package/_cjs/Supervisor.cjs +3 -3
- package/_cjs/TExit/constructors.cjs +1 -1
- package/_cjs/TExit.cjs +2 -2
- package/_cjs/TFuture/definition.cjs +4 -2
- package/_cjs/TFuture/definition.cjs.map +1 -1
- package/_cjs/TFuture.cjs +3 -3
- package/_cjs/TRef/api.cjs +2 -2
- package/_cjs/TRef/constructors.cjs +3 -3
- package/_cjs/TRef.cjs +3 -3
- package/_cjs/TSemaphore/api.cjs +1 -1
- package/_cjs/TSemaphore/definition.cjs +4 -2
- package/_cjs/TSemaphore/definition.cjs.map +1 -1
- package/_cjs/TSemaphore.cjs +3 -3
- package/_cjs/collection/immutable/Conc.cjs +3 -3
- package/_mjs/Channel/api/interruptWhen.mjs +1 -1
- package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
- package/_mjs/Channel/api/mapOutIOC.mjs +1 -1
- package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
- package/_mjs/Channel/api/mergeWith.mjs +6 -6
- package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +14 -14
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/internal/ChannelExecutor.mjs +2 -2
- package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +8 -7
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
- package/_mjs/Clock/api.mjs.map +1 -1
- package/_mjs/Clock/live.mjs +1 -1
- package/_mjs/Clock/live.mjs.map +1 -1
- package/_mjs/Fiber/FiberContext.mjs +57 -56
- package/_mjs/Fiber/FiberContext.mjs.map +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs +1 -1
- package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
- package/_mjs/FiberRef/constructors.mjs +1 -1
- package/_mjs/FiberRef/constructors.mjs.map +1 -1
- package/_mjs/FiberRefs/join.mjs +2 -2
- package/_mjs/FiberRefs/join.mjs.map +1 -1
- package/_mjs/IO/api/asyncIO.mjs +20 -0
- package/_mjs/IO/api/asyncIO.mjs.map +1 -0
- package/_mjs/IO/api/ensuringChildren.mjs +11 -0
- package/_mjs/IO/api/ensuringChildren.mjs.map +1 -0
- package/_mjs/IO/api/interrupt.mjs +4 -4
- package/_mjs/IO/api/interrupt.mjs.map +1 -1
- package/_mjs/IO/api/sleep.mjs.map +1 -1
- package/_mjs/IO/api/timeout.mjs +23 -0
- package/_mjs/IO/api/timeout.mjs.map +1 -0
- package/_mjs/IO/api.mjs +41 -40
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/definition.mjs +6 -4
- package/_mjs/IO/definition.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +1 -1
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IO.mjs +3 -0
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/Layer/api.mjs +4 -3
- package/_mjs/Layer/api.mjs.map +1 -1
- package/_mjs/Ref/Atomic/api.mjs +10 -6
- package/_mjs/Ref/Atomic/api.mjs.map +1 -1
- package/_mjs/Schedule/Decision.mjs.map +1 -1
- package/_mjs/Schedule/api/driver.mjs +10 -9
- package/_mjs/Schedule/api/driver.mjs.map +1 -1
- package/_mjs/Schedule/api.mjs +49 -49
- package/_mjs/Schedule/api.mjs.map +1 -1
- package/_mjs/Schedule.mjs +0 -1
- package/_mjs/Schedule.mjs.map +1 -1
- package/_mjs/Scope/Finalizer/definition.mjs +5 -4
- package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
- package/_mjs/Scope/ReleaseMap/definition.mjs +3 -2
- package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +1 -1
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +308 -302
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
- package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
- package/_mjs/Stream/internal/SinkEndReason.mjs +1 -30
- package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
- package/_mjs/TFuture/definition.mjs +3 -2
- package/_mjs/TFuture/definition.mjs.map +1 -1
- package/_mjs/TSemaphore/definition.mjs +3 -2
- package/_mjs/TSemaphore/definition.mjs.map +1 -1
- package/_src/Channel/api.ts +3 -3
- package/_src/Channel/internal/ChannelExecutor.ts +2 -2
- package/_src/Channel/internal/SingleProducerAsyncInput.ts +1 -0
- package/_src/Clock/api.ts +1 -1
- package/_src/Clock/definition.ts +1 -1
- package/_src/Clock/live.ts +2 -2
- package/_src/Fiber/FiberContext.ts +3 -2
- package/_src/Fiber/api/interruptFork.ts +1 -1
- package/_src/FiberRef/constructors.ts +1 -1
- package/_src/FiberRefs/join.ts +2 -2
- package/_src/IO/api/asyncIO.ts +16 -0
- package/_src/IO/api/ensuringChildren.ts +11 -0
- package/_src/IO/api/interrupt.ts +2 -1
- package/_src/IO/api/sequenceT.ts +1 -1
- package/_src/IO/api/sleep.ts +1 -1
- package/_src/IO/api/timeout.ts +19 -0
- package/_src/IO/api.ts +6 -4
- package/_src/IO/definition.ts +8 -4
- package/_src/IO.ts +3 -0
- package/_src/Layer/api.ts +1 -1
- package/_src/Ref/Atomic/api.ts +4 -0
- package/_src/Schedule/Decision.ts +0 -2
- package/_src/Schedule/api/driver.ts +1 -1
- package/_src/Schedule/api.ts +0 -3
- package/_src/Schedule.ts +0 -1
- package/_src/Scope/Finalizer/definition.ts +1 -1
- package/_src/Scope/ReleaseMap/definition.ts +1 -1
- package/_src/Stream/api.ts +199 -134
- package/_src/Stream/internal/DebounceState.ts +2 -2
- package/_src/Stream/internal/Handoff.ts +9 -9
- package/_src/Stream/internal/SinkEndReason.ts +7 -25
- package/_src/TFuture/definition.ts +2 -2
- package/_src/TSemaphore/definition.ts +1 -1
- package/package.json +5 -5
- package/runTests.d.ts +1 -0
- package/Schedule/Interval.d.ts +0 -71
- package/_cjs/Schedule/Interval.cjs +0 -154
- package/_cjs/Schedule/Interval.cjs.map +0 -1
- package/_mjs/Schedule/Interval.mjs +0 -114
- package/_mjs/Schedule/Interval.mjs.map +0 -1
- package/_src/Schedule/Interval.ts +0 -103
@@ -23,7 +23,7 @@ export const CurrentTag = Symbol();
|
|
23
23
|
export type CurrentTag = typeof CurrentTag;
|
24
24
|
export class Current<E, A> {
|
25
25
|
readonly _tag = DebounceStateTag.Current;
|
26
|
-
constructor(readonly fiber: Fiber<E, HandoffSignal<
|
26
|
+
constructor(readonly fiber: Fiber<E, HandoffSignal<E, A>>) {}
|
27
27
|
}
|
28
28
|
|
29
29
|
/**
|
@@ -53,7 +53,7 @@ export function previous<A>(fiber: Fiber<never, Conc<A>>): DebounceState<never,
|
|
53
53
|
/**
|
54
54
|
* @tsplus static fncts.io.Stream.DebounceStateOps Current
|
55
55
|
*/
|
56
|
-
export function current<E, A>(fiber: Fiber<E, HandoffSignal<
|
56
|
+
export function current<E, A>(fiber: Fiber<E, HandoffSignal<E, A>>): DebounceState<E, A> {
|
57
57
|
return new Current(fiber);
|
58
58
|
}
|
59
59
|
|
@@ -112,17 +112,17 @@ export class Halt<E> {
|
|
112
112
|
|
113
113
|
export const EndTypeId = Symbol("fncts.io.Stream.HandoffSignal.End");
|
114
114
|
export type EndTypeId = typeof EndTypeId;
|
115
|
-
export class End
|
115
|
+
export class End {
|
116
116
|
readonly _typeId: typeof HandoffSignalTypeId = HandoffSignalTypeId;
|
117
117
|
readonly _tag: typeof EndTypeId = EndTypeId;
|
118
118
|
|
119
|
-
constructor(readonly reason: SinkEndReason
|
119
|
+
constructor(readonly reason: SinkEndReason) {}
|
120
120
|
}
|
121
121
|
|
122
122
|
/**
|
123
123
|
* @tsplus type fncts.io.Stream.HandoffSignal
|
124
124
|
*/
|
125
|
-
export type HandoffSignal<
|
125
|
+
export type HandoffSignal<E, A> = Emit<A> | Halt<E> | End;
|
126
126
|
|
127
127
|
/**
|
128
128
|
* @tsplus type fncts.io.Stream.HandoffSignalOps
|
@@ -134,33 +134,33 @@ export const HandoffSignal: HandoffSignalOps = {};
|
|
134
134
|
/**
|
135
135
|
* @tsplus static fncts.io.Stream.HandoffSignalOps Emit
|
136
136
|
*/
|
137
|
-
export function emit<A>(els: Conc<A>): HandoffSignal<never,
|
137
|
+
export function emit<A>(els: Conc<A>): HandoffSignal<never, A> {
|
138
138
|
return new Emit(els);
|
139
139
|
}
|
140
140
|
|
141
141
|
/**
|
142
142
|
* @tsplus static fncts.io.Stream.HandoffSignalOps Halt
|
143
143
|
*/
|
144
|
-
export function halt<E>(error: Cause<E>): HandoffSignal<
|
144
|
+
export function halt<E>(error: Cause<E>): HandoffSignal<E, never> {
|
145
145
|
return new Halt(error);
|
146
146
|
}
|
147
147
|
|
148
148
|
/**
|
149
149
|
* @tsplus static fncts.io.Stream.HandoffSignalOps End
|
150
150
|
*/
|
151
|
-
export function end<C>(reason: SinkEndReason
|
151
|
+
export function end<C>(reason: SinkEndReason): HandoffSignal<never, never> {
|
152
152
|
return new End(reason);
|
153
153
|
}
|
154
154
|
|
155
155
|
/**
|
156
156
|
* @tsplus fluent fncts.io.Stream.HandoffSignal match
|
157
157
|
*/
|
158
|
-
export function matchSignal_<
|
159
|
-
signal: HandoffSignal<
|
158
|
+
export function matchSignal_<E, A, B, D, F>(
|
159
|
+
signal: HandoffSignal<E, A>,
|
160
160
|
cases: {
|
161
161
|
Emit: (_: Emit<A>) => B;
|
162
162
|
Halt: (_: Halt<E>) => D;
|
163
|
-
End: (_: End
|
163
|
+
End: (_: End) => F;
|
164
164
|
},
|
165
165
|
): B | D | F {
|
166
166
|
switch (signal._tag) {
|
@@ -7,21 +7,9 @@ export const enum SinkEndReasonTag {
|
|
7
7
|
|
8
8
|
export const SinkEndReasonTypeId = Symbol.for("fncts.io.Stream.SinkEndReason");
|
9
9
|
|
10
|
-
export class
|
11
|
-
readonly _typeId: typeof SinkEndReasonTypeId = SinkEndReasonTypeId;
|
12
|
-
readonly _tag = SinkEndReasonTag.SinkEnd;
|
13
|
-
}
|
14
|
-
|
15
|
-
export class ScheduleTimeout {
|
16
|
-
readonly _typeId: typeof SinkEndReasonTypeId = SinkEndReasonTypeId;
|
17
|
-
readonly _tag = SinkEndReasonTag.ScheduleTimeout;
|
18
|
-
}
|
19
|
-
|
20
|
-
export class ScheduleEnd<C> {
|
10
|
+
export class ScheduleEnd {
|
21
11
|
readonly _typeId: typeof SinkEndReasonTypeId = SinkEndReasonTypeId;
|
22
12
|
readonly _tag = SinkEndReasonTag.ScheduleEnd;
|
23
|
-
|
24
|
-
constructor(readonly c: C) {}
|
25
13
|
}
|
26
14
|
|
27
15
|
export class UpstreamEnd {
|
@@ -32,25 +20,19 @@ export class UpstreamEnd {
|
|
32
20
|
/**
|
33
21
|
* @tsplus type fncts.io.Stream.SinkEndReason
|
34
22
|
*/
|
35
|
-
export type SinkEndReason
|
23
|
+
export type SinkEndReason = ScheduleEnd | UpstreamEnd;
|
36
24
|
|
37
25
|
/**
|
38
26
|
* @tsplus fluent fncts.io.Stream.SinkEndReason match
|
39
27
|
*/
|
40
|
-
export function matchSinkEndReason_<A, B
|
41
|
-
self: SinkEndReason
|
28
|
+
export function matchSinkEndReason_<A, B>(
|
29
|
+
self: SinkEndReason,
|
42
30
|
cases: {
|
43
|
-
|
44
|
-
|
45
|
-
ScheduleEnd: (_: ScheduleEnd<A>) => D;
|
46
|
-
UpstreamEnd: (_: UpstreamEnd) => E;
|
31
|
+
ScheduleEnd: (_: ScheduleEnd) => A;
|
32
|
+
UpstreamEnd: (_: UpstreamEnd) => B;
|
47
33
|
},
|
48
|
-
):
|
34
|
+
): A | B {
|
49
35
|
switch (self._tag) {
|
50
|
-
case SinkEndReasonTag.SinkEnd:
|
51
|
-
return cases.SinkEnd(self);
|
52
|
-
case SinkEndReasonTag.ScheduleTimeout:
|
53
|
-
return cases.ScheduleTimeout(self);
|
54
36
|
case SinkEndReasonTag.ScheduleEnd:
|
55
37
|
return cases.ScheduleEnd(self);
|
56
38
|
case SinkEndReasonTag.UpstreamEnd:
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { UTRef } from "../TRef.js";
|
2
2
|
|
3
3
|
interface TFutureN extends HKT {
|
4
|
-
readonly
|
4
|
+
readonly [HKT.T]: TFuture<HKT._E<this>, HKT._A<this>>;
|
5
5
|
}
|
6
6
|
|
7
7
|
/**
|
@@ -20,4 +20,4 @@ export interface TFuture<E, A>
|
|
20
20
|
*/
|
21
21
|
export interface TFutureOps extends NewtypeIso<TFutureN> {}
|
22
22
|
|
23
|
-
export const TFuture: TFutureOps = Newtype<TFutureN>();
|
23
|
+
export const TFuture: TFutureOps = Newtype<TFutureN>();
|
package/package.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fncts/io",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.4",
|
4
4
|
"dependencies": {
|
5
|
-
"@fncts/base": "0.0.
|
6
|
-
"@fncts/typelevel": "0.0.
|
5
|
+
"@fncts/base": "0.0.4",
|
6
|
+
"@fncts/typelevel": "0.0.4"
|
7
7
|
},
|
8
8
|
"exports": {
|
9
9
|
"./*": {
|
10
|
-
"import": "./_mjs
|
11
|
-
"require": "./_cjs
|
10
|
+
"import": "./_mjs/*.mjs",
|
11
|
+
"require": "./_cjs/*.cjs"
|
12
12
|
}
|
13
13
|
},
|
14
14
|
"publishConfig": {
|
package/runTests.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/Schedule/Interval.d.ts
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
import { Maybe } from "@fncts/base/data/Maybe";
|
2
|
-
/**
|
3
|
-
* @tsplus type fncts.io.Schedule.Interval
|
4
|
-
* @tsplus companion fncts.io.Schedule.IntervalOps
|
5
|
-
*/
|
6
|
-
export declare class Interval {
|
7
|
-
readonly startMilliseconds: number;
|
8
|
-
readonly endMilliseconds: number;
|
9
|
-
constructor(startMilliseconds: number, endMilliseconds: number);
|
10
|
-
}
|
11
|
-
/**
|
12
|
-
* @tsplus static fncts.io.Schedule.IntervalOps after
|
13
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
14
|
-
*/
|
15
|
-
export declare function after(start: number): Interval;
|
16
|
-
/**
|
17
|
-
* @tsplus static fncts.io.Schedule.IntervalOps before
|
18
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
19
|
-
*/
|
20
|
-
export declare function before(end: number): Interval;
|
21
|
-
/**
|
22
|
-
* @tsplus static fncts.io.Schedule.IntervalOps empty
|
23
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
24
|
-
*/
|
25
|
-
export declare const empty: Interval;
|
26
|
-
/**
|
27
|
-
* @tsplus getter fncts.io.Schedule.Interval isEmpty
|
28
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
29
|
-
*/
|
30
|
-
export declare function isEmpty(self: Interval): boolean;
|
31
|
-
/**
|
32
|
-
* @tsplus fluent fncts.io.Schedule.Interval intersect
|
33
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
34
|
-
*/
|
35
|
-
export declare function intersect_(self: Interval, that: Interval): Interval;
|
36
|
-
/**
|
37
|
-
* @tsplus fluent fncts.io.Schedule.Interval lt
|
38
|
-
* @tsplus operator fncts.io.Schedule.Interval <
|
39
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
40
|
-
*/
|
41
|
-
export declare function lt_(self: Interval, that: Interval): boolean;
|
42
|
-
/**
|
43
|
-
* @tsplus static fncts.io.Schedule.IntervalOps __call
|
44
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
45
|
-
*/
|
46
|
-
export declare function makeInterval(start: number, end: number): Interval;
|
47
|
-
/**
|
48
|
-
* @tsplus fluent fncts.io.Schedule.Interval max
|
49
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
50
|
-
*/
|
51
|
-
export declare function max_(self: Interval, that: Interval): Interval;
|
52
|
-
/**
|
53
|
-
* @tsplus fluent fncts.io.Schedule.Interval min
|
54
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
55
|
-
*/
|
56
|
-
export declare function min_(self: Interval, that: Interval): Interval;
|
57
|
-
/**
|
58
|
-
* @tsplus getter fncts.io.Schedule.Interval isNonEmpty
|
59
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
60
|
-
*/
|
61
|
-
export declare function isNonEmpty(self: Interval): boolean;
|
62
|
-
/**
|
63
|
-
* @tsplus getter fncts.io.Schedule.Interval size
|
64
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
65
|
-
*/
|
66
|
-
export declare function size(self: Interval): number;
|
67
|
-
/**
|
68
|
-
* @tsplus fluent fncts.io.Schedule.Interval union
|
69
|
-
* @tsplus location "@fncts/io/Schedule/Interval"
|
70
|
-
*/
|
71
|
-
export declare function union_(self: Interval, that: Interval): Maybe<Interval>;
|
@@ -1,154 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Interval = void 0;
|
7
|
-
exports.after = after;
|
8
|
-
exports.before = before;
|
9
|
-
exports.empty = void 0;
|
10
|
-
exports.intersect_ = intersect_;
|
11
|
-
exports.isEmpty = void 0;
|
12
|
-
exports.isNonEmpty = isNonEmpty;
|
13
|
-
exports.lt_ = lt_;
|
14
|
-
exports.makeInterval = void 0;
|
15
|
-
exports.max_ = max_;
|
16
|
-
exports.min_ = void 0;
|
17
|
-
exports.size = size;
|
18
|
-
exports.union_ = union_;
|
19
|
-
|
20
|
-
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
|
21
|
-
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
|
-
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
25
|
-
|
26
|
-
const isEmpty = isEmpty_1;
|
27
|
-
exports.isEmpty = isEmpty;
|
28
|
-
const makeInterval = makeInterval_1;
|
29
|
-
exports.makeInterval = makeInterval;
|
30
|
-
const min_ = min_1;
|
31
|
-
/**
|
32
|
-
* @tsplus type fncts.io.Schedule.Interval
|
33
|
-
* @tsplus companion fncts.io.Schedule.IntervalOps
|
34
|
-
*/
|
35
|
-
|
36
|
-
exports.min_ = min_;
|
37
|
-
|
38
|
-
class Interval {
|
39
|
-
constructor(startMilliseconds, endMilliseconds) {
|
40
|
-
this.startMilliseconds = startMilliseconds;
|
41
|
-
this.endMilliseconds = endMilliseconds;
|
42
|
-
}
|
43
|
-
|
44
|
-
}
|
45
|
-
/**
|
46
|
-
* @tsplus static fncts.io.Schedule.IntervalOps after
|
47
|
-
*/
|
48
|
-
|
49
|
-
|
50
|
-
exports.Interval = Interval;
|
51
|
-
|
52
|
-
function after(start) {
|
53
|
-
return makeInterval_1(start, Number.MAX_SAFE_INTEGER);
|
54
|
-
}
|
55
|
-
/**
|
56
|
-
* @tsplus static fncts.io.Schedule.IntervalOps before
|
57
|
-
*/
|
58
|
-
|
59
|
-
|
60
|
-
function before(end) {
|
61
|
-
return makeInterval_1(Number.MIN_SAFE_INTEGER, end);
|
62
|
-
}
|
63
|
-
/**
|
64
|
-
* @tsplus static fncts.io.Schedule.IntervalOps empty
|
65
|
-
*/
|
66
|
-
|
67
|
-
|
68
|
-
const empty_1 = /*#__PURE__*/new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
|
69
|
-
const empty = empty_1;
|
70
|
-
/**
|
71
|
-
* @tsplus getter fncts.io.Schedule.Interval isEmpty
|
72
|
-
*/
|
73
|
-
|
74
|
-
exports.empty = empty;
|
75
|
-
|
76
|
-
function isEmpty_1(self) {
|
77
|
-
return self.startMilliseconds >= self.endMilliseconds;
|
78
|
-
}
|
79
|
-
/**
|
80
|
-
* @tsplus fluent fncts.io.Schedule.Interval intersect
|
81
|
-
*/
|
82
|
-
|
83
|
-
|
84
|
-
function intersect_(self, that) {
|
85
|
-
const start = Math.max(self.startMilliseconds, that.startMilliseconds);
|
86
|
-
const end = Math.min(self.endMilliseconds, that.endMilliseconds);
|
87
|
-
return makeInterval_1(start, end);
|
88
|
-
}
|
89
|
-
/**
|
90
|
-
* @tsplus fluent fncts.io.Schedule.Interval lt
|
91
|
-
* @tsplus operator fncts.io.Schedule.Interval <
|
92
|
-
*/
|
93
|
-
|
94
|
-
|
95
|
-
function lt_(self, that) {
|
96
|
-
return min_1(self, that) === self;
|
97
|
-
}
|
98
|
-
/**
|
99
|
-
* @tsplus static fncts.io.Schedule.IntervalOps __call
|
100
|
-
*/
|
101
|
-
|
102
|
-
|
103
|
-
function makeInterval_1(start, end) {
|
104
|
-
if (start <= end) return makeInterval_1(start, end);else return empty_1;
|
105
|
-
}
|
106
|
-
/**
|
107
|
-
* @tsplus fluent fncts.io.Schedule.Interval max
|
108
|
-
*/
|
109
|
-
|
110
|
-
|
111
|
-
function max_(self, that) {
|
112
|
-
const m = min_1(self, that);
|
113
|
-
if (m === self) return that;else return self;
|
114
|
-
}
|
115
|
-
/**
|
116
|
-
* @tsplus fluent fncts.io.Schedule.Interval min
|
117
|
-
*/
|
118
|
-
|
119
|
-
|
120
|
-
function min_1(self, that) {
|
121
|
-
if (self.endMilliseconds <= that.startMilliseconds) return self;
|
122
|
-
if (that.endMilliseconds <= self.startMilliseconds) return that;
|
123
|
-
if (self.startMilliseconds < that.startMilliseconds) return self;
|
124
|
-
if (that.startMilliseconds < self.startMilliseconds) return that;
|
125
|
-
if (self.endMilliseconds <= that.endMilliseconds) return self;
|
126
|
-
return that;
|
127
|
-
}
|
128
|
-
/**
|
129
|
-
* @tsplus getter fncts.io.Schedule.Interval isNonEmpty
|
130
|
-
*/
|
131
|
-
|
132
|
-
|
133
|
-
function isNonEmpty(self) {
|
134
|
-
return !isEmpty_1(self);
|
135
|
-
}
|
136
|
-
/**
|
137
|
-
* @tsplus getter fncts.io.Schedule.Interval size
|
138
|
-
*/
|
139
|
-
|
140
|
-
|
141
|
-
function size(self) {
|
142
|
-
return self.endMilliseconds - self.startMilliseconds;
|
143
|
-
}
|
144
|
-
/**
|
145
|
-
* @tsplus fluent fncts.io.Schedule.Interval union
|
146
|
-
*/
|
147
|
-
|
148
|
-
|
149
|
-
function union_(self, that) {
|
150
|
-
const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
|
151
|
-
const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
|
152
|
-
if (istart <= iend) return tsplus_module_1.nothing();else return tsplus_module_1.just(makeInterval_1(istart, iend));
|
153
|
-
}
|
154
|
-
//# sourceMappingURL=Interval.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Interval.cjs","mappings":"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","names":["isEmpty","makeInterval","min_","Interval","constructor","startMilliseconds","endMilliseconds","after","start","makeInterval_1","Number","MAX_SAFE_INTEGER","before","end","MIN_SAFE_INTEGER","empty_1","empty","self","intersect_","that","Math","max","min","lt_","min_1","max_","m","isNonEmpty","size","union_","istart","iend","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/Schedule/Interval.ts"],"sourcesContent":[null]}
|
@@ -1,114 +0,0 @@
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
2
|
-
export const isEmpty = isEmpty_1;
|
3
|
-
export const makeInterval = makeInterval_1;
|
4
|
-
export const min_ = min_1;
|
5
|
-
/**
|
6
|
-
* @tsplus type fncts.io.Schedule.Interval
|
7
|
-
* @tsplus companion fncts.io.Schedule.IntervalOps
|
8
|
-
*/
|
9
|
-
|
10
|
-
export class Interval {
|
11
|
-
constructor(startMilliseconds, endMilliseconds) {
|
12
|
-
this.startMilliseconds = startMilliseconds;
|
13
|
-
this.endMilliseconds = endMilliseconds;
|
14
|
-
}
|
15
|
-
|
16
|
-
}
|
17
|
-
/**
|
18
|
-
* @tsplus static fncts.io.Schedule.IntervalOps after
|
19
|
-
*/
|
20
|
-
|
21
|
-
export function after(start) {
|
22
|
-
return makeInterval_1(start, Number.MAX_SAFE_INTEGER);
|
23
|
-
}
|
24
|
-
/**
|
25
|
-
* @tsplus static fncts.io.Schedule.IntervalOps before
|
26
|
-
*/
|
27
|
-
|
28
|
-
export function before(end) {
|
29
|
-
return makeInterval_1(Number.MIN_SAFE_INTEGER, end);
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* @tsplus static fncts.io.Schedule.IntervalOps empty
|
33
|
-
*/
|
34
|
-
|
35
|
-
const empty_1 = /*#__PURE__*/new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
|
36
|
-
export const empty = empty_1;
|
37
|
-
/**
|
38
|
-
* @tsplus getter fncts.io.Schedule.Interval isEmpty
|
39
|
-
*/
|
40
|
-
|
41
|
-
function isEmpty_1(self) {
|
42
|
-
return self.startMilliseconds >= self.endMilliseconds;
|
43
|
-
}
|
44
|
-
/**
|
45
|
-
* @tsplus fluent fncts.io.Schedule.Interval intersect
|
46
|
-
*/
|
47
|
-
|
48
|
-
|
49
|
-
export function intersect_(self, that) {
|
50
|
-
const start = Math.max(self.startMilliseconds, that.startMilliseconds);
|
51
|
-
const end = Math.min(self.endMilliseconds, that.endMilliseconds);
|
52
|
-
return makeInterval_1(start, end);
|
53
|
-
}
|
54
|
-
/**
|
55
|
-
* @tsplus fluent fncts.io.Schedule.Interval lt
|
56
|
-
* @tsplus operator fncts.io.Schedule.Interval <
|
57
|
-
*/
|
58
|
-
|
59
|
-
export function lt_(self, that) {
|
60
|
-
return min_1(self, that) === self;
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* @tsplus static fncts.io.Schedule.IntervalOps __call
|
64
|
-
*/
|
65
|
-
|
66
|
-
function makeInterval_1(start, end) {
|
67
|
-
if (start <= end) return makeInterval_1(start, end);else return empty_1;
|
68
|
-
}
|
69
|
-
/**
|
70
|
-
* @tsplus fluent fncts.io.Schedule.Interval max
|
71
|
-
*/
|
72
|
-
|
73
|
-
|
74
|
-
export function max_(self, that) {
|
75
|
-
const m = min_1(self, that);
|
76
|
-
if (m === self) return that;else return self;
|
77
|
-
}
|
78
|
-
/**
|
79
|
-
* @tsplus fluent fncts.io.Schedule.Interval min
|
80
|
-
*/
|
81
|
-
|
82
|
-
function min_1(self, that) {
|
83
|
-
if (self.endMilliseconds <= that.startMilliseconds) return self;
|
84
|
-
if (that.endMilliseconds <= self.startMilliseconds) return that;
|
85
|
-
if (self.startMilliseconds < that.startMilliseconds) return self;
|
86
|
-
if (that.startMilliseconds < self.startMilliseconds) return that;
|
87
|
-
if (self.endMilliseconds <= that.endMilliseconds) return self;
|
88
|
-
return that;
|
89
|
-
}
|
90
|
-
/**
|
91
|
-
* @tsplus getter fncts.io.Schedule.Interval isNonEmpty
|
92
|
-
*/
|
93
|
-
|
94
|
-
|
95
|
-
export function isNonEmpty(self) {
|
96
|
-
return !isEmpty_1(self);
|
97
|
-
}
|
98
|
-
/**
|
99
|
-
* @tsplus getter fncts.io.Schedule.Interval size
|
100
|
-
*/
|
101
|
-
|
102
|
-
export function size(self) {
|
103
|
-
return self.endMilliseconds - self.startMilliseconds;
|
104
|
-
}
|
105
|
-
/**
|
106
|
-
* @tsplus fluent fncts.io.Schedule.Interval union
|
107
|
-
*/
|
108
|
-
|
109
|
-
export function union_(self, that) {
|
110
|
-
const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
|
111
|
-
const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
|
112
|
-
if (istart <= iend) return tsplus_module_1.nothing();else return tsplus_module_1.just(makeInterval_1(istart, iend));
|
113
|
-
}
|
114
|
-
//# sourceMappingURL=Interval.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Interval.mjs","mappings":"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","names":["isEmpty","makeInterval","min_","Interval","constructor","startMilliseconds","endMilliseconds","after","start","makeInterval_1","Number","MAX_SAFE_INTEGER","before","end","MIN_SAFE_INTEGER","empty_1","empty","self","intersect_","that","Math","max","min","lt_","min_1","max_","m","isNonEmpty","size","union_","istart","iend","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/Schedule/Interval.ts"],"sourcesContent":[null]}
|
@@ -1,103 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @tsplus type fncts.io.Schedule.Interval
|
3
|
-
* @tsplus companion fncts.io.Schedule.IntervalOps
|
4
|
-
*/
|
5
|
-
export class Interval {
|
6
|
-
constructor(readonly startMilliseconds: number, readonly endMilliseconds: number) {}
|
7
|
-
}
|
8
|
-
|
9
|
-
/**
|
10
|
-
* @tsplus static fncts.io.Schedule.IntervalOps after
|
11
|
-
*/
|
12
|
-
export function after(start: number): Interval {
|
13
|
-
return Interval(start, Number.MAX_SAFE_INTEGER);
|
14
|
-
}
|
15
|
-
|
16
|
-
/**
|
17
|
-
* @tsplus static fncts.io.Schedule.IntervalOps before
|
18
|
-
*/
|
19
|
-
export function before(end: number): Interval {
|
20
|
-
return Interval(Number.MIN_SAFE_INTEGER, end);
|
21
|
-
}
|
22
|
-
|
23
|
-
/**
|
24
|
-
* @tsplus static fncts.io.Schedule.IntervalOps empty
|
25
|
-
*/
|
26
|
-
export const empty: Interval = new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
|
27
|
-
|
28
|
-
/**
|
29
|
-
* @tsplus getter fncts.io.Schedule.Interval isEmpty
|
30
|
-
*/
|
31
|
-
export function isEmpty(self: Interval): boolean {
|
32
|
-
return self.startMilliseconds >= self.endMilliseconds;
|
33
|
-
}
|
34
|
-
|
35
|
-
/**
|
36
|
-
* @tsplus fluent fncts.io.Schedule.Interval intersect
|
37
|
-
*/
|
38
|
-
export function intersect_(self: Interval, that: Interval): Interval {
|
39
|
-
const start = Math.max(self.startMilliseconds, that.startMilliseconds);
|
40
|
-
const end = Math.min(self.endMilliseconds, that.endMilliseconds);
|
41
|
-
return Interval(start, end);
|
42
|
-
}
|
43
|
-
|
44
|
-
/**
|
45
|
-
* @tsplus fluent fncts.io.Schedule.Interval lt
|
46
|
-
* @tsplus operator fncts.io.Schedule.Interval <
|
47
|
-
*/
|
48
|
-
export function lt_(self: Interval, that: Interval): boolean {
|
49
|
-
return self.min(that) === self;
|
50
|
-
}
|
51
|
-
|
52
|
-
/**
|
53
|
-
* @tsplus static fncts.io.Schedule.IntervalOps __call
|
54
|
-
*/
|
55
|
-
export function makeInterval(start: number, end: number): Interval {
|
56
|
-
if (start <= end) return Interval(start, end);
|
57
|
-
else return Interval.empty;
|
58
|
-
}
|
59
|
-
|
60
|
-
/**
|
61
|
-
* @tsplus fluent fncts.io.Schedule.Interval max
|
62
|
-
*/
|
63
|
-
export function max_(self: Interval, that: Interval): Interval {
|
64
|
-
const m = self.min(that);
|
65
|
-
if (m === self) return that;
|
66
|
-
else return self;
|
67
|
-
}
|
68
|
-
|
69
|
-
/**
|
70
|
-
* @tsplus fluent fncts.io.Schedule.Interval min
|
71
|
-
*/
|
72
|
-
export function min_(self: Interval, that: Interval): Interval {
|
73
|
-
if (self.endMilliseconds <= that.startMilliseconds) return self;
|
74
|
-
if (that.endMilliseconds <= self.startMilliseconds) return that;
|
75
|
-
if (self.startMilliseconds < that.startMilliseconds) return self;
|
76
|
-
if (that.startMilliseconds < self.startMilliseconds) return that;
|
77
|
-
if (self.endMilliseconds <= that.endMilliseconds) return self;
|
78
|
-
return that;
|
79
|
-
}
|
80
|
-
|
81
|
-
/**
|
82
|
-
* @tsplus getter fncts.io.Schedule.Interval isNonEmpty
|
83
|
-
*/
|
84
|
-
export function isNonEmpty(self: Interval): boolean {
|
85
|
-
return !self.isEmpty;
|
86
|
-
}
|
87
|
-
|
88
|
-
/**
|
89
|
-
* @tsplus getter fncts.io.Schedule.Interval size
|
90
|
-
*/
|
91
|
-
export function size(self: Interval): number {
|
92
|
-
return self.endMilliseconds - self.startMilliseconds;
|
93
|
-
}
|
94
|
-
|
95
|
-
/**
|
96
|
-
* @tsplus fluent fncts.io.Schedule.Interval union
|
97
|
-
*/
|
98
|
-
export function union_(self: Interval, that: Interval): Maybe<Interval> {
|
99
|
-
const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
|
100
|
-
const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
|
101
|
-
if (istart <= iend) return Nothing();
|
102
|
-
else return Just(Interval(istart, iend));
|
103
|
-
}
|