effect 3.10.18 → 3.11.0
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/dist/cjs/Array.js +206 -0
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/BigDecimal.js +181 -24
- package/dist/cjs/BigDecimal.js.map +1 -1
- package/dist/cjs/BigInt.js +54 -0
- package/dist/cjs/BigInt.js.map +1 -1
- package/dist/cjs/Boolean.js +24 -0
- package/dist/cjs/Boolean.js.map +1 -1
- package/dist/cjs/Brand.js +4 -0
- package/dist/cjs/Brand.js.map +1 -1
- package/dist/cjs/Channel.js +44 -4
- package/dist/cjs/Channel.js.map +1 -1
- package/dist/cjs/Chunk.js +8 -0
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Config.js +10 -1
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Context.js +50 -1
- package/dist/cjs/Context.js.map +1 -1
- package/dist/cjs/Cron.js +81 -67
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/Data.js +14 -0
- package/dist/cjs/Data.js.map +1 -1
- package/dist/cjs/DateTime.js +178 -664
- package/dist/cjs/DateTime.js.map +1 -1
- package/dist/cjs/Duration.js +2 -0
- package/dist/cjs/Duration.js.map +1 -1
- package/dist/cjs/Effect.js +296 -4
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +38 -2
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/FiberHandle.js +6 -0
- package/dist/cjs/FiberHandle.js.map +1 -1
- package/dist/cjs/FiberMap.js +6 -0
- package/dist/cjs/FiberMap.js.map +1 -1
- package/dist/cjs/FiberSet.js +6 -0
- package/dist/cjs/FiberSet.js.map +1 -1
- package/dist/cjs/Function.js +34 -0
- package/dist/cjs/Function.js.map +1 -1
- package/dist/cjs/GlobalValue.js +2 -0
- package/dist/cjs/GlobalValue.js.map +1 -1
- package/dist/cjs/HashMap.js.map +1 -1
- package/dist/cjs/Inspectable.js +8 -4
- package/dist/cjs/Inspectable.js.map +1 -1
- package/dist/cjs/Iterable.js +18 -0
- package/dist/cjs/Iterable.js.map +1 -1
- package/dist/cjs/JSONSchema.js.map +1 -1
- package/dist/cjs/List.js +4 -0
- package/dist/cjs/List.js.map +1 -1
- package/dist/cjs/Logger.js +26 -0
- package/dist/cjs/Logger.js.map +1 -1
- package/dist/cjs/Mailbox.js +2 -0
- package/dist/cjs/Mailbox.js.map +1 -1
- package/dist/cjs/ManagedRuntime.js +2 -0
- package/dist/cjs/ManagedRuntime.js.map +1 -1
- package/dist/cjs/Metric.js +10 -0
- package/dist/cjs/Metric.js.map +1 -1
- package/dist/cjs/Micro.js +1104 -1069
- package/dist/cjs/Micro.js.map +1 -1
- package/dist/cjs/Number.js +44 -0
- package/dist/cjs/Number.js.map +1 -1
- package/dist/cjs/Option.js +70 -0
- package/dist/cjs/Option.js.map +1 -1
- package/dist/cjs/Order.js +2 -0
- package/dist/cjs/Order.js.map +1 -1
- package/dist/cjs/Ordering.js +4 -0
- package/dist/cjs/Ordering.js.map +1 -1
- package/dist/cjs/Predicate.js +68 -0
- package/dist/cjs/Predicate.js.map +1 -1
- package/dist/cjs/Random.js +4 -0
- package/dist/cjs/Random.js.map +1 -1
- package/dist/cjs/RateLimiter.js +4 -0
- package/dist/cjs/RateLimiter.js.map +1 -1
- package/dist/cjs/RcMap.js +2 -0
- package/dist/cjs/RcMap.js.map +1 -1
- package/dist/cjs/RcRef.js +2 -0
- package/dist/cjs/RcRef.js.map +1 -1
- package/dist/cjs/Record.js +56 -0
- package/dist/cjs/Record.js.map +1 -1
- package/dist/cjs/Redacted.js +8 -0
- package/dist/cjs/Redacted.js.map +1 -1
- package/dist/cjs/RegExp.js +4 -0
- package/dist/cjs/RegExp.js.map +1 -1
- package/dist/cjs/Request.js +4 -0
- package/dist/cjs/Request.js.map +1 -1
- package/dist/cjs/RequestResolver.js +2 -0
- package/dist/cjs/RequestResolver.js.map +1 -1
- package/dist/cjs/Runtime.js +6 -0
- package/dist/cjs/Runtime.js.map +1 -1
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schema.js +91 -8
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/Sink.js +9 -1
- package/dist/cjs/Sink.js.map +1 -1
- package/dist/cjs/Stream.js +179 -7
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/String.js +62 -0
- package/dist/cjs/String.js.map +1 -1
- package/dist/cjs/Struct.js +12 -0
- package/dist/cjs/Struct.js.map +1 -1
- package/dist/cjs/Symbol.js +2 -0
- package/dist/cjs/Symbol.js.map +1 -1
- package/dist/cjs/Trie.js +56 -0
- package/dist/cjs/Trie.js.map +1 -1
- package/dist/cjs/Tuple.js +18 -0
- package/dist/cjs/Tuple.js.map +1 -1
- package/dist/cjs/Utils.js +7 -1
- package/dist/cjs/Utils.js.map +1 -1
- package/dist/cjs/internal/channel/channelExecutor.js +5 -9
- package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
- package/dist/cjs/internal/channel.js +156 -130
- package/dist/cjs/internal/channel.js.map +1 -1
- package/dist/cjs/internal/config.js +13 -4
- package/dist/cjs/internal/config.js.map +1 -1
- package/dist/cjs/internal/context.js +46 -3
- package/dist/cjs/internal/context.js.map +1 -1
- package/dist/cjs/internal/dateTime.js +747 -0
- package/dist/cjs/internal/dateTime.js.map +1 -0
- package/dist/cjs/internal/fiberRuntime.js +34 -11
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/groupBy.js +9 -3
- package/dist/cjs/internal/groupBy.js.map +1 -1
- package/dist/cjs/internal/layer.js +1 -1
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/mailbox.js +1 -1
- package/dist/cjs/internal/mailbox.js.map +1 -1
- package/dist/cjs/internal/sink.js +25 -21
- package/dist/cjs/internal/sink.js.map +1 -1
- package/dist/cjs/internal/stream.js +70 -71
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/Array.d.ts +534 -0
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/BigDecimal.d.ts +172 -1
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/BigInt.d.ts +114 -0
- package/dist/dts/BigInt.d.ts.map +1 -1
- package/dist/dts/Boolean.d.ts +56 -0
- package/dist/dts/Boolean.d.ts.map +1 -1
- package/dist/dts/Brand.d.ts +6 -0
- package/dist/dts/Brand.d.ts.map +1 -1
- package/dist/dts/Channel.d.ts +66 -5
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +30 -0
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Config.d.ts +25 -1
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Context.d.ts +155 -0
- package/dist/dts/Context.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts +21 -6
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/Data.d.ts +26 -0
- package/dist/dts/Data.d.ts.map +1 -1
- package/dist/dts/DateTime.d.ts +192 -49
- package/dist/dts/DateTime.d.ts.map +1 -1
- package/dist/dts/Duration.d.ts +2 -0
- package/dist/dts/Duration.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +658 -1
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +84 -2
- package/dist/dts/Either.d.ts.map +1 -1
- package/dist/dts/FiberHandle.d.ts +6 -0
- package/dist/dts/FiberHandle.d.ts.map +1 -1
- package/dist/dts/FiberMap.d.ts +6 -0
- package/dist/dts/FiberMap.d.ts.map +1 -1
- package/dist/dts/FiberSet.d.ts +6 -0
- package/dist/dts/FiberSet.d.ts.map +1 -1
- package/dist/dts/Function.d.ts +50 -0
- package/dist/dts/Function.d.ts.map +1 -1
- package/dist/dts/GlobalValue.d.ts +2 -0
- package/dist/dts/GlobalValue.d.ts.map +1 -1
- package/dist/dts/HashMap.d.ts +6 -0
- package/dist/dts/HashMap.d.ts.map +1 -1
- package/dist/dts/Inspectable.d.ts.map +1 -1
- package/dist/dts/Iterable.d.ts +26 -0
- package/dist/dts/Iterable.d.ts.map +1 -1
- package/dist/dts/JSONSchema.d.ts +1 -0
- package/dist/dts/JSONSchema.d.ts.map +1 -1
- package/dist/dts/List.d.ts +20 -0
- package/dist/dts/List.d.ts.map +1 -1
- package/dist/dts/Logger.d.ts +34 -0
- package/dist/dts/Logger.d.ts.map +1 -1
- package/dist/dts/Mailbox.d.ts +2 -0
- package/dist/dts/Mailbox.d.ts.map +1 -1
- package/dist/dts/ManagedRuntime.d.ts +2 -0
- package/dist/dts/ManagedRuntime.d.ts.map +1 -1
- package/dist/dts/Metric.d.ts +18 -0
- package/dist/dts/Metric.d.ts.map +1 -1
- package/dist/dts/Micro.d.ts +880 -863
- package/dist/dts/Micro.d.ts.map +1 -1
- package/dist/dts/Number.d.ts +104 -0
- package/dist/dts/Number.d.ts.map +1 -1
- package/dist/dts/Option.d.ts +142 -0
- package/dist/dts/Option.d.ts.map +1 -1
- package/dist/dts/Order.d.ts +2 -0
- package/dist/dts/Order.d.ts.map +1 -1
- package/dist/dts/Ordering.d.ts +8 -0
- package/dist/dts/Ordering.d.ts.map +1 -1
- package/dist/dts/Predicate.d.ts +104 -0
- package/dist/dts/Predicate.d.ts.map +1 -1
- package/dist/dts/Random.d.ts +4 -0
- package/dist/dts/Random.d.ts.map +1 -1
- package/dist/dts/RateLimiter.d.ts +4 -0
- package/dist/dts/RateLimiter.d.ts.map +1 -1
- package/dist/dts/RcMap.d.ts +6 -0
- package/dist/dts/RcMap.d.ts.map +1 -1
- package/dist/dts/RcRef.d.ts +2 -0
- package/dist/dts/RcRef.d.ts.map +1 -1
- package/dist/dts/Record.d.ts +136 -0
- package/dist/dts/Record.d.ts.map +1 -1
- package/dist/dts/Redacted.d.ts +8 -0
- package/dist/dts/Redacted.d.ts.map +1 -1
- package/dist/dts/RegExp.d.ts +4 -0
- package/dist/dts/RegExp.d.ts.map +1 -1
- package/dist/dts/Request.d.ts +4 -0
- package/dist/dts/Request.d.ts.map +1 -1
- package/dist/dts/RequestResolver.d.ts +6 -0
- package/dist/dts/RequestResolver.d.ts.map +1 -1
- package/dist/dts/Runtime.d.ts +18 -0
- package/dist/dts/Runtime.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +2 -0
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +90 -0
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/Sink.d.ts +8 -0
- package/dist/dts/Sink.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +394 -32
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/String.d.ts +94 -0
- package/dist/dts/String.d.ts.map +1 -1
- package/dist/dts/Struct.d.ts +24 -0
- package/dist/dts/Struct.d.ts.map +1 -1
- package/dist/dts/Symbol.d.ts +2 -0
- package/dist/dts/Symbol.d.ts.map +1 -1
- package/dist/dts/Trie.d.ts +132 -0
- package/dist/dts/Trie.d.ts.map +1 -1
- package/dist/dts/Tuple.d.ts +42 -0
- package/dist/dts/Tuple.d.ts.map +1 -1
- package/dist/dts/Types.d.ts +24 -0
- package/dist/dts/Types.d.ts.map +1 -1
- package/dist/dts/Utils.d.ts +4 -0
- package/dist/dts/Utils.d.ts.map +1 -1
- package/dist/dts/internal/context.d.ts +1 -1
- package/dist/dts/internal/context.d.ts.map +1 -1
- package/dist/dts/internal/dateTime.d.ts +2 -0
- package/dist/dts/internal/dateTime.d.ts.map +1 -0
- package/dist/dts/internal/fiberRuntime.d.ts.map +1 -1
- package/dist/dts/internal/stream.d.ts.map +1 -1
- package/dist/esm/Array.js +208 -0
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/BigDecimal.js +175 -20
- package/dist/esm/BigDecimal.js.map +1 -1
- package/dist/esm/BigInt.js +54 -0
- package/dist/esm/BigInt.js.map +1 -1
- package/dist/esm/Boolean.js +24 -0
- package/dist/esm/Boolean.js.map +1 -1
- package/dist/esm/Brand.js +4 -0
- package/dist/esm/Brand.js.map +1 -1
- package/dist/esm/Channel.js +42 -2
- package/dist/esm/Channel.js.map +1 -1
- package/dist/esm/Chunk.js +8 -0
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Config.js +9 -0
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Context.js +49 -0
- package/dist/esm/Context.js.map +1 -1
- package/dist/esm/Cron.js +81 -67
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/Data.js +16 -0
- package/dist/esm/Data.js.map +1 -1
- package/dist/esm/DateTime.js +176 -627
- package/dist/esm/DateTime.js.map +1 -1
- package/dist/esm/Duration.js +2 -0
- package/dist/esm/Duration.js.map +1 -1
- package/dist/esm/Effect.js +297 -0
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +40 -2
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/FiberHandle.js +6 -0
- package/dist/esm/FiberHandle.js.map +1 -1
- package/dist/esm/FiberMap.js +6 -0
- package/dist/esm/FiberMap.js.map +1 -1
- package/dist/esm/FiberSet.js +6 -0
- package/dist/esm/FiberSet.js.map +1 -1
- package/dist/esm/Function.js +34 -0
- package/dist/esm/Function.js.map +1 -1
- package/dist/esm/GlobalValue.js +2 -0
- package/dist/esm/GlobalValue.js.map +1 -1
- package/dist/esm/HashMap.js.map +1 -1
- package/dist/esm/Inspectable.js +8 -4
- package/dist/esm/Inspectable.js.map +1 -1
- package/dist/esm/Iterable.js +18 -0
- package/dist/esm/Iterable.js.map +1 -1
- package/dist/esm/JSONSchema.js.map +1 -1
- package/dist/esm/List.js +4 -0
- package/dist/esm/List.js.map +1 -1
- package/dist/esm/Logger.js +26 -0
- package/dist/esm/Logger.js.map +1 -1
- package/dist/esm/Mailbox.js +2 -0
- package/dist/esm/Mailbox.js.map +1 -1
- package/dist/esm/ManagedRuntime.js +2 -0
- package/dist/esm/ManagedRuntime.js.map +1 -1
- package/dist/esm/Metric.js +10 -0
- package/dist/esm/Metric.js.map +1 -1
- package/dist/esm/Micro.js +1077 -1037
- package/dist/esm/Micro.js.map +1 -1
- package/dist/esm/Number.js +44 -0
- package/dist/esm/Number.js.map +1 -1
- package/dist/esm/Option.js +72 -0
- package/dist/esm/Option.js.map +1 -1
- package/dist/esm/Order.js +2 -0
- package/dist/esm/Order.js.map +1 -1
- package/dist/esm/Ordering.js +4 -0
- package/dist/esm/Ordering.js.map +1 -1
- package/dist/esm/Predicate.js +68 -0
- package/dist/esm/Predicate.js.map +1 -1
- package/dist/esm/Random.js +4 -0
- package/dist/esm/Random.js.map +1 -1
- package/dist/esm/RateLimiter.js +4 -0
- package/dist/esm/RateLimiter.js.map +1 -1
- package/dist/esm/RcMap.js +2 -0
- package/dist/esm/RcMap.js.map +1 -1
- package/dist/esm/RcRef.js +2 -0
- package/dist/esm/RcRef.js.map +1 -1
- package/dist/esm/Record.js +56 -0
- package/dist/esm/Record.js.map +1 -1
- package/dist/esm/Redacted.js +8 -0
- package/dist/esm/Redacted.js.map +1 -1
- package/dist/esm/RegExp.js +4 -0
- package/dist/esm/RegExp.js.map +1 -1
- package/dist/esm/Request.js +4 -0
- package/dist/esm/Request.js.map +1 -1
- package/dist/esm/RequestResolver.js +2 -0
- package/dist/esm/RequestResolver.js.map +1 -1
- package/dist/esm/Runtime.js +6 -0
- package/dist/esm/Runtime.js.map +1 -1
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schema.js +88 -0
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/Sink.js +8 -0
- package/dist/esm/Sink.js.map +1 -1
- package/dist/esm/Stream.js +183 -5
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/String.js +62 -0
- package/dist/esm/String.js.map +1 -1
- package/dist/esm/Struct.js +12 -0
- package/dist/esm/Struct.js.map +1 -1
- package/dist/esm/Symbol.js +2 -0
- package/dist/esm/Symbol.js.map +1 -1
- package/dist/esm/Trie.js +56 -0
- package/dist/esm/Trie.js.map +1 -1
- package/dist/esm/Tuple.js +22 -0
- package/dist/esm/Tuple.js.map +1 -1
- package/dist/esm/Utils.js +5 -0
- package/dist/esm/Utils.js.map +1 -1
- package/dist/esm/internal/channel/channelExecutor.js +5 -7
- package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
- package/dist/esm/internal/channel.js +152 -129
- package/dist/esm/internal/channel.js.map +1 -1
- package/dist/esm/internal/config.js +11 -3
- package/dist/esm/internal/config.js.map +1 -1
- package/dist/esm/internal/context.js +42 -2
- package/dist/esm/internal/context.js.map +1 -1
- package/dist/esm/internal/dateTime.js +704 -0
- package/dist/esm/internal/dateTime.js.map +1 -0
- package/dist/esm/internal/fiberRuntime.js +31 -9
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/groupBy.js +9 -3
- package/dist/esm/internal/groupBy.js.map +1 -1
- package/dist/esm/internal/layer.js +1 -1
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/mailbox.js +1 -1
- package/dist/esm/internal/mailbox.js.map +1 -1
- package/dist/esm/internal/sink.js +23 -20
- package/dist/esm/internal/sink.js.map +1 -1
- package/dist/esm/internal/stream.js +66 -69
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +534 -0
- package/src/BigDecimal.ts +247 -21
- package/src/BigInt.ts +114 -0
- package/src/Boolean.ts +56 -0
- package/src/Brand.ts +6 -0
- package/src/Channel.ts +81 -5
- package/src/Chunk.ts +32 -0
- package/src/Config.ts +26 -1
- package/src/Context.ts +163 -0
- package/src/Cron.ts +91 -68
- package/src/Data.ts +26 -0
- package/src/DateTime.ts +307 -757
- package/src/Duration.ts +2 -0
- package/src/Effect.ts +910 -1
- package/src/Either.ts +84 -2
- package/src/FiberHandle.ts +6 -0
- package/src/FiberMap.ts +6 -0
- package/src/FiberSet.ts +6 -0
- package/src/Function.ts +50 -0
- package/src/GlobalValue.ts +2 -0
- package/src/HashMap.ts +6 -0
- package/src/Inspectable.ts +11 -7
- package/src/Iterable.ts +26 -0
- package/src/JSONSchema.ts +1 -0
- package/src/List.ts +24 -0
- package/src/Logger.ts +34 -0
- package/src/Mailbox.ts +2 -0
- package/src/ManagedRuntime.ts +2 -0
- package/src/Metric.ts +18 -0
- package/src/Micro.ts +2007 -1745
- package/src/Number.ts +104 -0
- package/src/Option.ts +142 -0
- package/src/Order.ts +2 -0
- package/src/Ordering.ts +8 -0
- package/src/Predicate.ts +104 -0
- package/src/Random.ts +4 -0
- package/src/RateLimiter.ts +4 -0
- package/src/RcMap.ts +6 -0
- package/src/RcRef.ts +2 -0
- package/src/Record.ts +136 -0
- package/src/Redacted.ts +8 -0
- package/src/RegExp.ts +4 -0
- package/src/Request.ts +4 -0
- package/src/RequestResolver.ts +6 -0
- package/src/Runtime.ts +18 -0
- package/src/STM.ts +2 -0
- package/src/Schema.ts +124 -0
- package/src/Sink.ts +11 -0
- package/src/Stream.ts +399 -44
- package/src/String.ts +94 -0
- package/src/Struct.ts +24 -0
- package/src/Symbol.ts +2 -0
- package/src/Trie.ts +132 -0
- package/src/Tuple.ts +42 -0
- package/src/Types.ts +24 -0
- package/src/Utils.ts +8 -0
- package/src/internal/channel/channelExecutor.ts +37 -33
- package/src/internal/channel.ts +504 -467
- package/src/internal/config.ts +18 -6
- package/src/internal/context.ts +56 -4
- package/src/internal/dateTime.ts +1126 -0
- package/src/internal/fiberRuntime.ts +35 -16
- package/src/internal/groupBy.ts +13 -22
- package/src/internal/layer.ts +5 -8
- package/src/internal/mailbox.ts +6 -4
- package/src/internal/sink.ts +55 -35
- package/src/internal/stream.ts +299 -299
- package/src/internal/version.ts +1 -1
package/src/Stream.ts
CHANGED
|
@@ -193,6 +193,7 @@ export const accumulateChunks: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E,
|
|
|
193
193
|
* stream is consumed.
|
|
194
194
|
*
|
|
195
195
|
* @example
|
|
196
|
+
* ```ts
|
|
196
197
|
* import { Console, Effect, Stream } from "effect"
|
|
197
198
|
*
|
|
198
199
|
* // Simulating File operations
|
|
@@ -214,6 +215,7 @@ export const accumulateChunks: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E,
|
|
|
214
215
|
* // Opening file.txt
|
|
215
216
|
* // Closing file.txt
|
|
216
217
|
* // { _id: 'Chunk', values: [ [ 'Line 1', 'Line 2', 'Line 3' ] ] }
|
|
218
|
+
* ```
|
|
217
219
|
*
|
|
218
220
|
* @since 2.0.0
|
|
219
221
|
* @category constructors
|
|
@@ -379,12 +381,14 @@ export const aggregateWithinEither: {
|
|
|
379
381
|
* Maps the success values of this stream to the specified constant value.
|
|
380
382
|
*
|
|
381
383
|
* @example
|
|
384
|
+
* ```ts
|
|
382
385
|
* import { Effect, Stream } from "effect"
|
|
383
386
|
*
|
|
384
387
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
385
388
|
*
|
|
386
389
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
387
390
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
391
|
+
* ```
|
|
388
392
|
*
|
|
389
393
|
* @since 2.0.0
|
|
390
394
|
* @category mapping
|
|
@@ -394,12 +398,14 @@ export const as: {
|
|
|
394
398
|
* Maps the success values of this stream to the specified constant value.
|
|
395
399
|
*
|
|
396
400
|
* @example
|
|
401
|
+
* ```ts
|
|
397
402
|
* import { Effect, Stream } from "effect"
|
|
398
403
|
*
|
|
399
404
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
400
405
|
*
|
|
401
406
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
402
407
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
408
|
+
* ```
|
|
403
409
|
*
|
|
404
410
|
* @since 2.0.0
|
|
405
411
|
* @category mapping
|
|
@@ -409,12 +415,14 @@ export const as: {
|
|
|
409
415
|
* Maps the success values of this stream to the specified constant value.
|
|
410
416
|
*
|
|
411
417
|
* @example
|
|
418
|
+
* ```ts
|
|
412
419
|
* import { Effect, Stream } from "effect"
|
|
413
420
|
*
|
|
414
421
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
415
422
|
*
|
|
416
423
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
417
424
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
425
|
+
* ```
|
|
418
426
|
*
|
|
419
427
|
* @since 2.0.0
|
|
420
428
|
* @category mapping
|
|
@@ -440,6 +448,7 @@ export {
|
|
|
440
448
|
* executed if the `Fiber` executing this Effect is interrupted.
|
|
441
449
|
*
|
|
442
450
|
* @example
|
|
451
|
+
* ```ts
|
|
443
452
|
* import type { StreamEmit } from "effect"
|
|
444
453
|
* import { Chunk, Effect, Option, Stream } from "effect"
|
|
445
454
|
*
|
|
@@ -462,6 +471,7 @@ export {
|
|
|
462
471
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
463
472
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
464
473
|
*
|
|
474
|
+
* ```
|
|
465
475
|
* @since 2.0.0
|
|
466
476
|
* @category constructors
|
|
467
477
|
*/
|
|
@@ -499,6 +509,7 @@ export const asyncEffect: <A, E = never, R = never>(
|
|
|
499
509
|
* second argument with the `bufferSize` and `strategy` fields.
|
|
500
510
|
*
|
|
501
511
|
* @example
|
|
512
|
+
* ```ts
|
|
502
513
|
* import { Effect, Stream } from "effect"
|
|
503
514
|
*
|
|
504
515
|
* Stream.asyncPush<string>((emit) =>
|
|
@@ -513,6 +524,7 @@ export const asyncEffect: <A, E = never, R = never>(
|
|
|
513
524
|
* clearInterval(handle)
|
|
514
525
|
* })
|
|
515
526
|
* ), { bufferSize: 16, strategy: "dropping" })
|
|
527
|
+
* ```
|
|
516
528
|
*
|
|
517
529
|
* @since 3.6.0
|
|
518
530
|
* @category constructors
|
|
@@ -584,6 +596,7 @@ export const branchAfter: {
|
|
|
584
596
|
* chunks before the slowest downstream stream.
|
|
585
597
|
*
|
|
586
598
|
* @example
|
|
599
|
+
* ```ts
|
|
587
600
|
* import { Console, Effect, Fiber, Schedule, Stream } from "effect"
|
|
588
601
|
*
|
|
589
602
|
* const numbers = Effect.scoped(
|
|
@@ -653,6 +666,7 @@ export const branchAfter: {
|
|
|
653
666
|
* // Logging to the Console: 19
|
|
654
667
|
* // Logging to the Console: 20
|
|
655
668
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
669
|
+
* ```
|
|
656
670
|
*
|
|
657
671
|
* @since 2.0.0
|
|
658
672
|
* @category utils
|
|
@@ -664,6 +678,7 @@ export const broadcast: {
|
|
|
664
678
|
* chunks before the slowest downstream stream.
|
|
665
679
|
*
|
|
666
680
|
* @example
|
|
681
|
+
* ```ts
|
|
667
682
|
* import { Console, Effect, Fiber, Schedule, Stream } from "effect"
|
|
668
683
|
*
|
|
669
684
|
* const numbers = Effect.scoped(
|
|
@@ -733,6 +748,7 @@ export const broadcast: {
|
|
|
733
748
|
* // Logging to the Console: 19
|
|
734
749
|
* // Logging to the Console: 20
|
|
735
750
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
751
|
+
* ```
|
|
736
752
|
*
|
|
737
753
|
* @since 2.0.0
|
|
738
754
|
* @category utils
|
|
@@ -751,6 +767,7 @@ export const broadcast: {
|
|
|
751
767
|
* chunks before the slowest downstream stream.
|
|
752
768
|
*
|
|
753
769
|
* @example
|
|
770
|
+
* ```ts
|
|
754
771
|
* import { Console, Effect, Fiber, Schedule, Stream } from "effect"
|
|
755
772
|
*
|
|
756
773
|
* const numbers = Effect.scoped(
|
|
@@ -820,6 +837,7 @@ export const broadcast: {
|
|
|
820
837
|
* // Logging to the Console: 19
|
|
821
838
|
* // Logging to the Console: 20
|
|
822
839
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
840
|
+
* ```
|
|
823
841
|
*
|
|
824
842
|
* @since 2.0.0
|
|
825
843
|
* @category utils
|
|
@@ -1040,6 +1058,7 @@ export const broadcastedQueuesDynamic: {
|
|
|
1040
1058
|
* of 2 for better performance.
|
|
1041
1059
|
*
|
|
1042
1060
|
* @example
|
|
1061
|
+
* ```ts
|
|
1043
1062
|
* import { Console, Effect, Schedule, Stream } from "effect"
|
|
1044
1063
|
*
|
|
1045
1064
|
* const stream = Stream.range(1, 10).pipe(
|
|
@@ -1066,6 +1085,7 @@ export const broadcastedQueuesDynamic: {
|
|
|
1066
1085
|
* // after buffering: 5
|
|
1067
1086
|
* // before buffering: 10
|
|
1068
1087
|
* // ...
|
|
1088
|
+
* ```
|
|
1069
1089
|
*
|
|
1070
1090
|
* @since 2.0.0
|
|
1071
1091
|
* @category utils
|
|
@@ -1080,6 +1100,7 @@ export const buffer: {
|
|
|
1080
1100
|
* of 2 for better performance.
|
|
1081
1101
|
*
|
|
1082
1102
|
* @example
|
|
1103
|
+
* ```ts
|
|
1083
1104
|
* import { Console, Effect, Schedule, Stream } from "effect"
|
|
1084
1105
|
*
|
|
1085
1106
|
* const stream = Stream.range(1, 10).pipe(
|
|
@@ -1106,6 +1127,7 @@ export const buffer: {
|
|
|
1106
1127
|
* // after buffering: 5
|
|
1107
1128
|
* // before buffering: 10
|
|
1108
1129
|
* // ...
|
|
1130
|
+
* ```
|
|
1109
1131
|
*
|
|
1110
1132
|
* @since 2.0.0
|
|
1111
1133
|
* @category utils
|
|
@@ -1125,6 +1147,7 @@ export const buffer: {
|
|
|
1125
1147
|
* of 2 for better performance.
|
|
1126
1148
|
*
|
|
1127
1149
|
* @example
|
|
1150
|
+
* ```ts
|
|
1128
1151
|
* import { Console, Effect, Schedule, Stream } from "effect"
|
|
1129
1152
|
*
|
|
1130
1153
|
* const stream = Stream.range(1, 10).pipe(
|
|
@@ -1151,6 +1174,7 @@ export const buffer: {
|
|
|
1151
1174
|
* // after buffering: 5
|
|
1152
1175
|
* // before buffering: 10
|
|
1153
1176
|
* // ...
|
|
1177
|
+
* ```
|
|
1154
1178
|
*
|
|
1155
1179
|
* @since 2.0.0
|
|
1156
1180
|
* @category utils
|
|
@@ -1430,12 +1454,14 @@ export const catchSomeCause: {
|
|
|
1430
1454
|
* elements are equal.
|
|
1431
1455
|
*
|
|
1432
1456
|
* @example
|
|
1457
|
+
* ```ts
|
|
1433
1458
|
* import { Effect, Stream } from "effect"
|
|
1434
1459
|
*
|
|
1435
1460
|
* const stream = Stream.make(1, 1, 1, 2, 2, 3, 4).pipe(Stream.changes)
|
|
1436
1461
|
*
|
|
1437
1462
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1438
1463
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
|
|
1464
|
+
* ```
|
|
1439
1465
|
*
|
|
1440
1466
|
* @since 2.0.0
|
|
1441
1467
|
* @category utils
|
|
@@ -1661,6 +1687,7 @@ export const combineChunks: {
|
|
|
1661
1687
|
* specified stream.
|
|
1662
1688
|
*
|
|
1663
1689
|
* @example
|
|
1690
|
+
* ```ts
|
|
1664
1691
|
* import { Effect, Stream } from "effect"
|
|
1665
1692
|
*
|
|
1666
1693
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1670,6 +1697,7 @@ export const combineChunks: {
|
|
|
1670
1697
|
*
|
|
1671
1698
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1672
1699
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1700
|
+
* ```
|
|
1673
1701
|
*
|
|
1674
1702
|
* @since 2.0.0
|
|
1675
1703
|
* @category utils
|
|
@@ -1681,6 +1709,7 @@ export const concat: {
|
|
|
1681
1709
|
* specified stream.
|
|
1682
1710
|
*
|
|
1683
1711
|
* @example
|
|
1712
|
+
* ```ts
|
|
1684
1713
|
* import { Effect, Stream } from "effect"
|
|
1685
1714
|
*
|
|
1686
1715
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1690,6 +1719,7 @@ export const concat: {
|
|
|
1690
1719
|
*
|
|
1691
1720
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1692
1721
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1722
|
+
* ```
|
|
1693
1723
|
*
|
|
1694
1724
|
* @since 2.0.0
|
|
1695
1725
|
* @category utils
|
|
@@ -1701,6 +1731,7 @@ export const concat: {
|
|
|
1701
1731
|
* specified stream.
|
|
1702
1732
|
*
|
|
1703
1733
|
* @example
|
|
1734
|
+
* ```ts
|
|
1704
1735
|
* import { Effect, Stream } from "effect"
|
|
1705
1736
|
*
|
|
1706
1737
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1710,6 +1741,7 @@ export const concat: {
|
|
|
1710
1741
|
*
|
|
1711
1742
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1712
1743
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1744
|
+
* ```
|
|
1713
1745
|
*
|
|
1714
1746
|
* @since 2.0.0
|
|
1715
1747
|
* @category utils
|
|
@@ -1721,6 +1753,7 @@ export const concat: {
|
|
|
1721
1753
|
* Concatenates all of the streams in the chunk to one stream.
|
|
1722
1754
|
*
|
|
1723
1755
|
* @example
|
|
1756
|
+
* ```ts
|
|
1724
1757
|
* import { Chunk, Effect, Stream } from "effect"
|
|
1725
1758
|
*
|
|
1726
1759
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1737,6 +1770,7 @@ export const concat: {
|
|
|
1737
1770
|
* // 5, 6, 7, 8
|
|
1738
1771
|
* // ]
|
|
1739
1772
|
* // }
|
|
1773
|
+
* ```
|
|
1740
1774
|
*
|
|
1741
1775
|
* @since 2.0.0
|
|
1742
1776
|
* @category constructors
|
|
@@ -1751,6 +1785,7 @@ export const concatAll: <A, E, R>(streams: Chunk.Chunk<Stream<A, E, R>>) => Stre
|
|
|
1751
1785
|
* See also `Stream.zip` for the more common point-wise variant.
|
|
1752
1786
|
*
|
|
1753
1787
|
* @example
|
|
1788
|
+
* ```ts
|
|
1754
1789
|
* import { Effect, Stream } from "effect"
|
|
1755
1790
|
*
|
|
1756
1791
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1765,6 +1800,7 @@ export const concatAll: <A, E, R>(streams: Chunk.Chunk<Stream<A, E, R>>) => Stre
|
|
|
1765
1800
|
* // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
|
|
1766
1801
|
* // ]
|
|
1767
1802
|
* // }
|
|
1803
|
+
* ```
|
|
1768
1804
|
*
|
|
1769
1805
|
* @since 2.0.0
|
|
1770
1806
|
* @category utils
|
|
@@ -1778,6 +1814,7 @@ export const cross: {
|
|
|
1778
1814
|
* See also `Stream.zip` for the more common point-wise variant.
|
|
1779
1815
|
*
|
|
1780
1816
|
* @example
|
|
1817
|
+
* ```ts
|
|
1781
1818
|
* import { Effect, Stream } from "effect"
|
|
1782
1819
|
*
|
|
1783
1820
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1792,6 +1829,7 @@ export const cross: {
|
|
|
1792
1829
|
* // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
|
|
1793
1830
|
* // ]
|
|
1794
1831
|
* // }
|
|
1832
|
+
* ```
|
|
1795
1833
|
*
|
|
1796
1834
|
* @since 2.0.0
|
|
1797
1835
|
* @category utils
|
|
@@ -1805,6 +1843,7 @@ export const cross: {
|
|
|
1805
1843
|
* See also `Stream.zip` for the more common point-wise variant.
|
|
1806
1844
|
*
|
|
1807
1845
|
* @example
|
|
1846
|
+
* ```ts
|
|
1808
1847
|
* import { Effect, Stream } from "effect"
|
|
1809
1848
|
*
|
|
1810
1849
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1819,6 +1858,7 @@ export const cross: {
|
|
|
1819
1858
|
* // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
|
|
1820
1859
|
* // ]
|
|
1821
1860
|
* // }
|
|
1861
|
+
* ```
|
|
1822
1862
|
*
|
|
1823
1863
|
* @since 2.0.0
|
|
1824
1864
|
* @category utils
|
|
@@ -1953,6 +1993,7 @@ export const crossWith: {
|
|
|
1953
1993
|
* has paused typing so as to not prematurely recommend results.
|
|
1954
1994
|
*
|
|
1955
1995
|
* @example
|
|
1996
|
+
* ```ts
|
|
1956
1997
|
* import { Effect, Stream } from "effect"
|
|
1957
1998
|
*
|
|
1958
1999
|
* let last = Date.now()
|
|
@@ -1990,6 +2031,7 @@ export const crossWith: {
|
|
|
1990
2031
|
* // Received 8 after 1ms
|
|
1991
2032
|
* // > Emitted 8 after 101ms
|
|
1992
2033
|
* // { _id: 'Chunk', values: [ 3, 6, 8 ] }
|
|
2034
|
+
* ```
|
|
1993
2035
|
*
|
|
1994
2036
|
* @since 2.0.0
|
|
1995
2037
|
* @category utils
|
|
@@ -2007,6 +2049,7 @@ export const debounce: {
|
|
|
2007
2049
|
* has paused typing so as to not prematurely recommend results.
|
|
2008
2050
|
*
|
|
2009
2051
|
* @example
|
|
2052
|
+
* ```ts
|
|
2010
2053
|
* import { Effect, Stream } from "effect"
|
|
2011
2054
|
*
|
|
2012
2055
|
* let last = Date.now()
|
|
@@ -2044,6 +2087,7 @@ export const debounce: {
|
|
|
2044
2087
|
* // Received 8 after 1ms
|
|
2045
2088
|
* // > Emitted 8 after 101ms
|
|
2046
2089
|
* // { _id: 'Chunk', values: [ 3, 6, 8 ] }
|
|
2090
|
+
* ```
|
|
2047
2091
|
*
|
|
2048
2092
|
* @since 2.0.0
|
|
2049
2093
|
* @category utils
|
|
@@ -2061,6 +2105,7 @@ export const debounce: {
|
|
|
2061
2105
|
* has paused typing so as to not prematurely recommend results.
|
|
2062
2106
|
*
|
|
2063
2107
|
* @example
|
|
2108
|
+
* ```ts
|
|
2064
2109
|
* import { Effect, Stream } from "effect"
|
|
2065
2110
|
*
|
|
2066
2111
|
* let last = Date.now()
|
|
@@ -2098,6 +2143,7 @@ export const debounce: {
|
|
|
2098
2143
|
* // Received 8 after 1ms
|
|
2099
2144
|
* // > Emitted 8 after 101ms
|
|
2100
2145
|
* // { _id: 'Chunk', values: [ 3, 6, 8 ] }
|
|
2146
|
+
* ```
|
|
2101
2147
|
*
|
|
2102
2148
|
* @since 2.0.0
|
|
2103
2149
|
* @category utils
|
|
@@ -2231,6 +2277,7 @@ export const distributedWithDynamic: {
|
|
|
2231
2277
|
* elements. Useful for sequencing effects using streams:
|
|
2232
2278
|
*
|
|
2233
2279
|
* @example
|
|
2280
|
+
* ```ts
|
|
2234
2281
|
* import { Effect, Stream } from "effect"
|
|
2235
2282
|
*
|
|
2236
2283
|
* // We create a stream and immediately drain it.
|
|
@@ -2238,6 +2285,7 @@ export const distributedWithDynamic: {
|
|
|
2238
2285
|
*
|
|
2239
2286
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2240
2287
|
* // { _id: 'Chunk', values: [] }
|
|
2288
|
+
* ```
|
|
2241
2289
|
*
|
|
2242
2290
|
* @since 2.0.0
|
|
2243
2291
|
* @category utils
|
|
@@ -2455,12 +2503,14 @@ export const either: <A, E, R>(self: Stream<A, E, R>) => Stream<Either.Either<A,
|
|
|
2455
2503
|
* The empty stream.
|
|
2456
2504
|
*
|
|
2457
2505
|
* @example
|
|
2506
|
+
* ```ts
|
|
2458
2507
|
* import { Effect, Stream } from "effect"
|
|
2459
2508
|
*
|
|
2460
2509
|
* const stream = Stream.empty
|
|
2461
2510
|
*
|
|
2462
2511
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2463
2512
|
* // { _id: 'Chunk', values: [] }
|
|
2513
|
+
* ```
|
|
2464
2514
|
*
|
|
2465
2515
|
* @since 2.0.0
|
|
2466
2516
|
* @category constructors
|
|
@@ -2471,6 +2521,7 @@ export const empty: Stream<never> = internal.empty
|
|
|
2471
2521
|
* Executes the provided finalizer after this stream's finalizers run.
|
|
2472
2522
|
*
|
|
2473
2523
|
* @example
|
|
2524
|
+
* ```ts
|
|
2474
2525
|
* import { Console, Effect, Stream } from "effect"
|
|
2475
2526
|
*
|
|
2476
2527
|
* const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
|
|
@@ -2485,6 +2536,7 @@ export const empty: Stream<never> = internal.empty
|
|
|
2485
2536
|
* // Finalizing the stream
|
|
2486
2537
|
* // Doing some other works after stream's finalization
|
|
2487
2538
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2539
|
+
* ```
|
|
2488
2540
|
*
|
|
2489
2541
|
* @since 2.0.0
|
|
2490
2542
|
* @category utils
|
|
@@ -2494,6 +2546,7 @@ export const ensuring: {
|
|
|
2494
2546
|
* Executes the provided finalizer after this stream's finalizers run.
|
|
2495
2547
|
*
|
|
2496
2548
|
* @example
|
|
2549
|
+
* ```ts
|
|
2497
2550
|
* import { Console, Effect, Stream } from "effect"
|
|
2498
2551
|
*
|
|
2499
2552
|
* const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
|
|
@@ -2508,6 +2561,7 @@ export const ensuring: {
|
|
|
2508
2561
|
* // Finalizing the stream
|
|
2509
2562
|
* // Doing some other works after stream's finalization
|
|
2510
2563
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2564
|
+
* ```
|
|
2511
2565
|
*
|
|
2512
2566
|
* @since 2.0.0
|
|
2513
2567
|
* @category utils
|
|
@@ -2517,6 +2571,7 @@ export const ensuring: {
|
|
|
2517
2571
|
* Executes the provided finalizer after this stream's finalizers run.
|
|
2518
2572
|
*
|
|
2519
2573
|
* @example
|
|
2574
|
+
* ```ts
|
|
2520
2575
|
* import { Console, Effect, Stream } from "effect"
|
|
2521
2576
|
*
|
|
2522
2577
|
* const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
|
|
@@ -2531,6 +2586,7 @@ export const ensuring: {
|
|
|
2531
2586
|
* // Finalizing the stream
|
|
2532
2587
|
* // Doing some other works after stream's finalization
|
|
2533
2588
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2589
|
+
* ```
|
|
2534
2590
|
*
|
|
2535
2591
|
* @since 2.0.0
|
|
2536
2592
|
* @category utils
|
|
@@ -2614,6 +2670,7 @@ export const execute: <X, E, R>(effect: Effect.Effect<X, E, R>) => Stream<never,
|
|
|
2614
2670
|
* Terminates with the specified error.
|
|
2615
2671
|
*
|
|
2616
2672
|
* @example
|
|
2673
|
+
* ```ts
|
|
2617
2674
|
* import { Effect, Stream } from "effect"
|
|
2618
2675
|
*
|
|
2619
2676
|
* const stream = Stream.fail("Uh oh!")
|
|
@@ -2624,6 +2681,7 @@ export const execute: <X, E, R>(effect: Effect.Effect<X, E, R>) => Stream<never,
|
|
|
2624
2681
|
* // _tag: 'Failure',
|
|
2625
2682
|
* // cause: { _id: 'Cause', _tag: 'Fail', failure: 'Uh oh!' }
|
|
2626
2683
|
* // }
|
|
2684
|
+
* ```
|
|
2627
2685
|
*
|
|
2628
2686
|
* @since 2.0.0
|
|
2629
2687
|
* @category constructors
|
|
@@ -2658,12 +2716,14 @@ export const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Stream<nev
|
|
|
2658
2716
|
* Filters the elements emitted by this stream using the provided function.
|
|
2659
2717
|
*
|
|
2660
2718
|
* @example
|
|
2719
|
+
* ```ts
|
|
2661
2720
|
* import { Effect, Stream } from "effect"
|
|
2662
2721
|
*
|
|
2663
2722
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2664
2723
|
*
|
|
2665
2724
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2666
2725
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2726
|
+
* ```
|
|
2667
2727
|
*
|
|
2668
2728
|
* @since 2.0.0
|
|
2669
2729
|
* @category filtering
|
|
@@ -2673,12 +2733,14 @@ export const filter: {
|
|
|
2673
2733
|
* Filters the elements emitted by this stream using the provided function.
|
|
2674
2734
|
*
|
|
2675
2735
|
* @example
|
|
2736
|
+
* ```ts
|
|
2676
2737
|
* import { Effect, Stream } from "effect"
|
|
2677
2738
|
*
|
|
2678
2739
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2679
2740
|
*
|
|
2680
2741
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2681
2742
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2743
|
+
* ```
|
|
2682
2744
|
*
|
|
2683
2745
|
* @since 2.0.0
|
|
2684
2746
|
* @category filtering
|
|
@@ -2688,12 +2750,14 @@ export const filter: {
|
|
|
2688
2750
|
* Filters the elements emitted by this stream using the provided function.
|
|
2689
2751
|
*
|
|
2690
2752
|
* @example
|
|
2753
|
+
* ```ts
|
|
2691
2754
|
* import { Effect, Stream } from "effect"
|
|
2692
2755
|
*
|
|
2693
2756
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2694
2757
|
*
|
|
2695
2758
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2696
2759
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2760
|
+
* ```
|
|
2697
2761
|
*
|
|
2698
2762
|
* @since 2.0.0
|
|
2699
2763
|
* @category filtering
|
|
@@ -2703,12 +2767,14 @@ export const filter: {
|
|
|
2703
2767
|
* Filters the elements emitted by this stream using the provided function.
|
|
2704
2768
|
*
|
|
2705
2769
|
* @example
|
|
2770
|
+
* ```ts
|
|
2706
2771
|
* import { Effect, Stream } from "effect"
|
|
2707
2772
|
*
|
|
2708
2773
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2709
2774
|
*
|
|
2710
2775
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2711
2776
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2777
|
+
* ```
|
|
2712
2778
|
*
|
|
2713
2779
|
* @since 2.0.0
|
|
2714
2780
|
* @category filtering
|
|
@@ -2718,12 +2784,14 @@ export const filter: {
|
|
|
2718
2784
|
* Filters the elements emitted by this stream using the provided function.
|
|
2719
2785
|
*
|
|
2720
2786
|
* @example
|
|
2787
|
+
* ```ts
|
|
2721
2788
|
* import { Effect, Stream } from "effect"
|
|
2722
2789
|
*
|
|
2723
2790
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2724
2791
|
*
|
|
2725
2792
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2726
2793
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2794
|
+
* ```
|
|
2727
2795
|
*
|
|
2728
2796
|
* @since 2.0.0
|
|
2729
2797
|
* @category filtering
|
|
@@ -2869,6 +2937,7 @@ export const filterMapWhileEffect: {
|
|
|
2869
2937
|
* when it ends.
|
|
2870
2938
|
*
|
|
2871
2939
|
* @example
|
|
2940
|
+
* ```ts
|
|
2872
2941
|
* import { Console, Effect, Stream } from "effect"
|
|
2873
2942
|
*
|
|
2874
2943
|
* const application = Stream.fromEffect(Console.log("Application Logic."))
|
|
@@ -2890,6 +2959,7 @@ export const filterMapWhileEffect: {
|
|
|
2890
2959
|
* // Deleting dir: tmp
|
|
2891
2960
|
* // Temporary directory was deleted.
|
|
2892
2961
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2962
|
+
* ```
|
|
2893
2963
|
*
|
|
2894
2964
|
* @since 2.0.0
|
|
2895
2965
|
* @category constructors
|
|
@@ -3136,6 +3206,7 @@ export const forever: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R> = inte
|
|
|
3136
3206
|
* Creates a stream from an `AsyncIterable`.
|
|
3137
3207
|
*
|
|
3138
3208
|
* @example
|
|
3209
|
+
* ```ts
|
|
3139
3210
|
* import { Effect, Stream } from "effect"
|
|
3140
3211
|
*
|
|
3141
3212
|
* const myAsyncIterable = async function*() {
|
|
@@ -3150,6 +3221,7 @@ export const forever: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R> = inte
|
|
|
3150
3221
|
*
|
|
3151
3222
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3152
3223
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
3224
|
+
* ```
|
|
3153
3225
|
*
|
|
3154
3226
|
* @since 2.0.0
|
|
3155
3227
|
* @category constructors
|
|
@@ -3181,6 +3253,7 @@ export const toChannel: <A, E, R>(
|
|
|
3181
3253
|
* Creates a stream from a `Chunk` of values.
|
|
3182
3254
|
*
|
|
3183
3255
|
* @example
|
|
3256
|
+
* ```ts
|
|
3184
3257
|
* import { Chunk, Effect, Stream } from "effect"
|
|
3185
3258
|
*
|
|
3186
3259
|
* // Creating a stream with values from a single Chunk
|
|
@@ -3188,6 +3261,7 @@ export const toChannel: <A, E, R>(
|
|
|
3188
3261
|
*
|
|
3189
3262
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3190
3263
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
3264
|
+
* ```
|
|
3191
3265
|
*
|
|
3192
3266
|
* @since 2.0.0
|
|
3193
3267
|
* @category constructors
|
|
@@ -3244,6 +3318,7 @@ export const fromChunkQueue: <A>(
|
|
|
3244
3318
|
* Creates a stream from an arbitrary number of chunks.
|
|
3245
3319
|
*
|
|
3246
3320
|
* @example
|
|
3321
|
+
* ```ts
|
|
3247
3322
|
* import { Chunk, Effect, Stream } from "effect"
|
|
3248
3323
|
*
|
|
3249
3324
|
* // Creating a stream with values from multiple Chunks
|
|
@@ -3251,6 +3326,7 @@ export const fromChunkQueue: <A>(
|
|
|
3251
3326
|
*
|
|
3252
3327
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3253
3328
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
3329
|
+
* ```
|
|
3254
3330
|
*
|
|
3255
3331
|
* @since 2.0.0
|
|
3256
3332
|
* @category constructors
|
|
@@ -3262,12 +3338,14 @@ export const fromChunks: <A>(...chunks: Array<Chunk.Chunk<A>>) => Stream<A> = in
|
|
|
3262
3338
|
* with the failure value of this effect.
|
|
3263
3339
|
*
|
|
3264
3340
|
* @example
|
|
3341
|
+
* ```ts
|
|
3265
3342
|
* import { Effect, Random, Stream } from "effect"
|
|
3266
3343
|
*
|
|
3267
3344
|
* const stream = Stream.fromEffect(Random.nextInt)
|
|
3268
3345
|
*
|
|
3269
3346
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3270
3347
|
* // Example Output: { _id: 'Chunk', values: [ 922694024 ] }
|
|
3348
|
+
* ```
|
|
3271
3349
|
*
|
|
3272
3350
|
* @since 2.0.0
|
|
3273
3351
|
* @category constructors
|
|
@@ -3336,6 +3414,7 @@ export const fromTPubSub: <A>(pubsub: TPubSub<A>) => Stream<A> = internal.fromTP
|
|
|
3336
3414
|
* Creates a new `Stream` from an iterable collection of values.
|
|
3337
3415
|
*
|
|
3338
3416
|
* @example
|
|
3417
|
+
* ```ts
|
|
3339
3418
|
* import { Effect, Stream } from "effect"
|
|
3340
3419
|
*
|
|
3341
3420
|
* const numbers = [1, 2, 3]
|
|
@@ -3344,6 +3423,7 @@ export const fromTPubSub: <A>(pubsub: TPubSub<A>) => Stream<A> = internal.fromTP
|
|
|
3344
3423
|
*
|
|
3345
3424
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3346
3425
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
3426
|
+
* ```
|
|
3347
3427
|
*
|
|
3348
3428
|
* @since 2.0.0
|
|
3349
3429
|
* @category constructors
|
|
@@ -3354,6 +3434,7 @@ export const fromIterable: <A>(iterable: Iterable<A>) => Stream<A> = internal.fr
|
|
|
3354
3434
|
* Creates a stream from an effect producing a value of type `Iterable<A>`.
|
|
3355
3435
|
*
|
|
3356
3436
|
* @example
|
|
3437
|
+
* ```ts
|
|
3357
3438
|
* import { Context, Effect, Stream } from "effect"
|
|
3358
3439
|
*
|
|
3359
3440
|
* class Database extends Context.Tag("Database")<
|
|
@@ -3369,6 +3450,7 @@ export const fromIterable: <A>(iterable: Iterable<A>) => Stream<A> = internal.fr
|
|
|
3369
3450
|
* // Stream.runCollect(stream.pipe(Stream.provideService(Database, { getUsers: Effect.succeed(["user1", "user2"]) })))
|
|
3370
3451
|
* // ).then(console.log)
|
|
3371
3452
|
* // { _id: 'Chunk', values: [ 'user1', 'user2' ] }
|
|
3453
|
+
* ```
|
|
3372
3454
|
*
|
|
3373
3455
|
* @since 2.0.0
|
|
3374
3456
|
* @category constructors
|
|
@@ -3505,6 +3587,7 @@ export const fromReadableStreamByob: {
|
|
|
3505
3587
|
* schedule, continuing for as long as the schedule continues.
|
|
3506
3588
|
*
|
|
3507
3589
|
* @example
|
|
3590
|
+
* ```ts
|
|
3508
3591
|
* import { Effect, Schedule, Stream } from "effect"
|
|
3509
3592
|
*
|
|
3510
3593
|
* // Emits values every 1 second for a total of 5 emissions
|
|
@@ -3516,6 +3599,7 @@ export const fromReadableStreamByob: {
|
|
|
3516
3599
|
*
|
|
3517
3600
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3518
3601
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
3602
|
+
* ```
|
|
3519
3603
|
*
|
|
3520
3604
|
* @since 2.0.0
|
|
3521
3605
|
* @category constructors
|
|
@@ -3553,6 +3637,7 @@ export const groupAdjacentBy: {
|
|
|
3553
3637
|
* More powerful version of `Stream.groupByKey`.
|
|
3554
3638
|
*
|
|
3555
3639
|
* @example
|
|
3640
|
+
* ```ts
|
|
3556
3641
|
* import { Chunk, Effect, GroupBy, Stream } from "effect"
|
|
3557
3642
|
*
|
|
3558
3643
|
* const groupByKeyResult = Stream.fromIterable([
|
|
@@ -3580,6 +3665,7 @@ export const groupAdjacentBy: {
|
|
|
3580
3665
|
* // _id: 'Chunk',
|
|
3581
3666
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
3582
3667
|
* // }
|
|
3668
|
+
* ```
|
|
3583
3669
|
*
|
|
3584
3670
|
* @since 2.0.0
|
|
3585
3671
|
* @category grouping
|
|
@@ -3589,6 +3675,7 @@ export const groupBy: {
|
|
|
3589
3675
|
* More powerful version of `Stream.groupByKey`.
|
|
3590
3676
|
*
|
|
3591
3677
|
* @example
|
|
3678
|
+
* ```ts
|
|
3592
3679
|
* import { Chunk, Effect, GroupBy, Stream } from "effect"
|
|
3593
3680
|
*
|
|
3594
3681
|
* const groupByKeyResult = Stream.fromIterable([
|
|
@@ -3616,6 +3703,7 @@ export const groupBy: {
|
|
|
3616
3703
|
* // _id: 'Chunk',
|
|
3617
3704
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
3618
3705
|
* // }
|
|
3706
|
+
* ```
|
|
3619
3707
|
*
|
|
3620
3708
|
* @since 2.0.0
|
|
3621
3709
|
* @category grouping
|
|
@@ -3628,6 +3716,7 @@ export const groupBy: {
|
|
|
3628
3716
|
* More powerful version of `Stream.groupByKey`.
|
|
3629
3717
|
*
|
|
3630
3718
|
* @example
|
|
3719
|
+
* ```ts
|
|
3631
3720
|
* import { Chunk, Effect, GroupBy, Stream } from "effect"
|
|
3632
3721
|
*
|
|
3633
3722
|
* const groupByKeyResult = Stream.fromIterable([
|
|
@@ -3655,6 +3744,7 @@ export const groupBy: {
|
|
|
3655
3744
|
* // _id: 'Chunk',
|
|
3656
3745
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
3657
3746
|
* // }
|
|
3747
|
+
* ```
|
|
3658
3748
|
*
|
|
3659
3749
|
* @since 2.0.0
|
|
3660
3750
|
* @category grouping
|
|
@@ -3797,6 +3887,7 @@ export const groupByKey: {
|
|
|
3797
3887
|
* Partitions the stream with specified `chunkSize`.
|
|
3798
3888
|
*
|
|
3799
3889
|
* @example
|
|
3890
|
+
* ```ts
|
|
3800
3891
|
* import { Effect, Stream } from "effect"
|
|
3801
3892
|
*
|
|
3802
3893
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
@@ -3811,6 +3902,7 @@ export const groupByKey: {
|
|
|
3811
3902
|
* // [length]: 3
|
|
3812
3903
|
* // ]
|
|
3813
3904
|
* // }
|
|
3905
|
+
* ```
|
|
3814
3906
|
*
|
|
3815
3907
|
* @since 2.0.0
|
|
3816
3908
|
* @category grouping
|
|
@@ -3820,6 +3912,7 @@ export const grouped: {
|
|
|
3820
3912
|
* Partitions the stream with specified `chunkSize`.
|
|
3821
3913
|
*
|
|
3822
3914
|
* @example
|
|
3915
|
+
* ```ts
|
|
3823
3916
|
* import { Effect, Stream } from "effect"
|
|
3824
3917
|
*
|
|
3825
3918
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
@@ -3834,6 +3927,7 @@ export const grouped: {
|
|
|
3834
3927
|
* // [length]: 3
|
|
3835
3928
|
* // ]
|
|
3836
3929
|
* // }
|
|
3930
|
+
* ```
|
|
3837
3931
|
*
|
|
3838
3932
|
* @since 2.0.0
|
|
3839
3933
|
* @category grouping
|
|
@@ -3843,6 +3937,7 @@ export const grouped: {
|
|
|
3843
3937
|
* Partitions the stream with specified `chunkSize`.
|
|
3844
3938
|
*
|
|
3845
3939
|
* @example
|
|
3940
|
+
* ```ts
|
|
3846
3941
|
* import { Effect, Stream } from "effect"
|
|
3847
3942
|
*
|
|
3848
3943
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
@@ -3857,6 +3952,7 @@ export const grouped: {
|
|
|
3857
3952
|
* // [length]: 3
|
|
3858
3953
|
* // ]
|
|
3859
3954
|
* // }
|
|
3955
|
+
* ```
|
|
3860
3956
|
*
|
|
3861
3957
|
* @since 2.0.0
|
|
3862
3958
|
* @category grouping
|
|
@@ -3869,6 +3965,7 @@ export const grouped: {
|
|
|
3869
3965
|
* `duration` has passed, whichever is satisfied first.
|
|
3870
3966
|
*
|
|
3871
3967
|
* @example
|
|
3968
|
+
* ```ts
|
|
3872
3969
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
3873
3970
|
*
|
|
3874
3971
|
* const stream = Stream.range(0, 9).pipe(
|
|
@@ -3904,6 +4001,7 @@ export const grouped: {
|
|
|
3904
4001
|
* // ]
|
|
3905
4002
|
* // }
|
|
3906
4003
|
* // ]
|
|
4004
|
+
* ```
|
|
3907
4005
|
*
|
|
3908
4006
|
* @since 2.0.0
|
|
3909
4007
|
* @category grouping
|
|
@@ -3914,6 +4012,7 @@ export const groupedWithin: {
|
|
|
3914
4012
|
* `duration` has passed, whichever is satisfied first.
|
|
3915
4013
|
*
|
|
3916
4014
|
* @example
|
|
4015
|
+
* ```ts
|
|
3917
4016
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
3918
4017
|
*
|
|
3919
4018
|
* const stream = Stream.range(0, 9).pipe(
|
|
@@ -3949,6 +4048,7 @@ export const groupedWithin: {
|
|
|
3949
4048
|
* // ]
|
|
3950
4049
|
* // }
|
|
3951
4050
|
* // ]
|
|
4051
|
+
* ```
|
|
3952
4052
|
*
|
|
3953
4053
|
* @since 2.0.0
|
|
3954
4054
|
* @category grouping
|
|
@@ -3962,6 +4062,7 @@ export const groupedWithin: {
|
|
|
3962
4062
|
* `duration` has passed, whichever is satisfied first.
|
|
3963
4063
|
*
|
|
3964
4064
|
* @example
|
|
4065
|
+
* ```ts
|
|
3965
4066
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
3966
4067
|
*
|
|
3967
4068
|
* const stream = Stream.range(0, 9).pipe(
|
|
@@ -3997,6 +4098,7 @@ export const groupedWithin: {
|
|
|
3997
4098
|
* // ]
|
|
3998
4099
|
* // }
|
|
3999
4100
|
* // ]
|
|
4101
|
+
* ```
|
|
4000
4102
|
*
|
|
4001
4103
|
* @since 2.0.0
|
|
4002
4104
|
* @category grouping
|
|
@@ -4127,6 +4229,7 @@ export const identity: <A, E = never, R = never>() => Stream<A, E, R> = internal
|
|
|
4127
4229
|
* pulled.
|
|
4128
4230
|
*
|
|
4129
4231
|
* @example
|
|
4232
|
+
* ```ts
|
|
4130
4233
|
* import { Effect, Stream } from "effect"
|
|
4131
4234
|
*
|
|
4132
4235
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -4136,6 +4239,7 @@ export const identity: <A, E = never, R = never>() => Stream<A, E, R> = internal
|
|
|
4136
4239
|
*
|
|
4137
4240
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4138
4241
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
4242
|
+
* ```
|
|
4139
4243
|
* @since 2.0.0
|
|
4140
4244
|
* @category utils
|
|
4141
4245
|
*/
|
|
@@ -4147,6 +4251,7 @@ export const interleave: {
|
|
|
4147
4251
|
* pulled.
|
|
4148
4252
|
*
|
|
4149
4253
|
* @example
|
|
4254
|
+
* ```ts
|
|
4150
4255
|
* import { Effect, Stream } from "effect"
|
|
4151
4256
|
*
|
|
4152
4257
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -4156,6 +4261,7 @@ export const interleave: {
|
|
|
4156
4261
|
*
|
|
4157
4262
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4158
4263
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
4264
|
+
* ```
|
|
4159
4265
|
* @since 2.0.0
|
|
4160
4266
|
* @category utils
|
|
4161
4267
|
*/
|
|
@@ -4167,6 +4273,7 @@ export const interleave: {
|
|
|
4167
4273
|
* pulled.
|
|
4168
4274
|
*
|
|
4169
4275
|
* @example
|
|
4276
|
+
* ```ts
|
|
4170
4277
|
* import { Effect, Stream } from "effect"
|
|
4171
4278
|
*
|
|
4172
4279
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -4176,6 +4283,7 @@ export const interleave: {
|
|
|
4176
4283
|
*
|
|
4177
4284
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4178
4285
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
4286
|
+
* ```
|
|
4179
4287
|
* @since 2.0.0
|
|
4180
4288
|
* @category utils
|
|
4181
4289
|
*/
|
|
@@ -4192,6 +4300,7 @@ export const interleave: {
|
|
|
4192
4300
|
* ignored.
|
|
4193
4301
|
*
|
|
4194
4302
|
* @example
|
|
4303
|
+
* ```ts
|
|
4195
4304
|
* import { Effect, Stream } from "effect"
|
|
4196
4305
|
*
|
|
4197
4306
|
* const s1 = Stream.make(1, 3, 5, 7, 9)
|
|
@@ -4209,6 +4318,7 @@ export const interleave: {
|
|
|
4209
4318
|
* // 8, 5, 10, 7, 9
|
|
4210
4319
|
* // ]
|
|
4211
4320
|
* // }
|
|
4321
|
+
* ```
|
|
4212
4322
|
*
|
|
4213
4323
|
* @since 2.0.0
|
|
4214
4324
|
* @category utils
|
|
@@ -4224,6 +4334,7 @@ export const interleaveWith: {
|
|
|
4224
4334
|
* ignored.
|
|
4225
4335
|
*
|
|
4226
4336
|
* @example
|
|
4337
|
+
* ```ts
|
|
4227
4338
|
* import { Effect, Stream } from "effect"
|
|
4228
4339
|
*
|
|
4229
4340
|
* const s1 = Stream.make(1, 3, 5, 7, 9)
|
|
@@ -4241,6 +4352,7 @@ export const interleaveWith: {
|
|
|
4241
4352
|
* // 8, 5, 10, 7, 9
|
|
4242
4353
|
* // ]
|
|
4243
4354
|
* // }
|
|
4355
|
+
* ```
|
|
4244
4356
|
*
|
|
4245
4357
|
* @since 2.0.0
|
|
4246
4358
|
* @category utils
|
|
@@ -4259,6 +4371,7 @@ export const interleaveWith: {
|
|
|
4259
4371
|
* ignored.
|
|
4260
4372
|
*
|
|
4261
4373
|
* @example
|
|
4374
|
+
* ```ts
|
|
4262
4375
|
* import { Effect, Stream } from "effect"
|
|
4263
4376
|
*
|
|
4264
4377
|
* const s1 = Stream.make(1, 3, 5, 7, 9)
|
|
@@ -4276,6 +4389,7 @@ export const interleaveWith: {
|
|
|
4276
4389
|
* // 8, 5, 10, 7, 9
|
|
4277
4390
|
* // ]
|
|
4278
4391
|
* // }
|
|
4392
|
+
* ```
|
|
4279
4393
|
*
|
|
4280
4394
|
* @since 2.0.0
|
|
4281
4395
|
* @category utils
|
|
@@ -4291,6 +4405,7 @@ export const interleaveWith: {
|
|
|
4291
4405
|
* Intersperse stream with provided `element`.
|
|
4292
4406
|
*
|
|
4293
4407
|
* @example
|
|
4408
|
+
* ```ts
|
|
4294
4409
|
* import { Effect, Stream } from "effect"
|
|
4295
4410
|
*
|
|
4296
4411
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
@@ -4303,6 +4418,7 @@ export const interleaveWith: {
|
|
|
4303
4418
|
* // 0, 4, 0, 5
|
|
4304
4419
|
* // ]
|
|
4305
4420
|
* // }
|
|
4421
|
+
* ```
|
|
4306
4422
|
*
|
|
4307
4423
|
* @since 2.0.0
|
|
4308
4424
|
* @category utils
|
|
@@ -4312,6 +4428,7 @@ export const intersperse: {
|
|
|
4312
4428
|
* Intersperse stream with provided `element`.
|
|
4313
4429
|
*
|
|
4314
4430
|
* @example
|
|
4431
|
+
* ```ts
|
|
4315
4432
|
* import { Effect, Stream } from "effect"
|
|
4316
4433
|
*
|
|
4317
4434
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
@@ -4324,6 +4441,7 @@ export const intersperse: {
|
|
|
4324
4441
|
* // 0, 4, 0, 5
|
|
4325
4442
|
* // ]
|
|
4326
4443
|
* // }
|
|
4444
|
+
* ```
|
|
4327
4445
|
*
|
|
4328
4446
|
* @since 2.0.0
|
|
4329
4447
|
* @category utils
|
|
@@ -4333,6 +4451,7 @@ export const intersperse: {
|
|
|
4333
4451
|
* Intersperse stream with provided `element`.
|
|
4334
4452
|
*
|
|
4335
4453
|
* @example
|
|
4454
|
+
* ```ts
|
|
4336
4455
|
* import { Effect, Stream } from "effect"
|
|
4337
4456
|
*
|
|
4338
4457
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
@@ -4345,6 +4464,7 @@ export const intersperse: {
|
|
|
4345
4464
|
* // 0, 4, 0, 5
|
|
4346
4465
|
* // ]
|
|
4347
4466
|
* // }
|
|
4467
|
+
* ```
|
|
4348
4468
|
*
|
|
4349
4469
|
* @since 2.0.0
|
|
4350
4470
|
* @category utils
|
|
@@ -4356,6 +4476,7 @@ export const intersperse: {
|
|
|
4356
4476
|
* Intersperse the specified element, also adding a prefix and a suffix.
|
|
4357
4477
|
*
|
|
4358
4478
|
* @example
|
|
4479
|
+
* ```ts
|
|
4359
4480
|
* import { Effect, Stream } from "effect"
|
|
4360
4481
|
*
|
|
4361
4482
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(
|
|
@@ -4375,6 +4496,7 @@ export const intersperse: {
|
|
|
4375
4496
|
* // ']'
|
|
4376
4497
|
* // ]
|
|
4377
4498
|
* // }
|
|
4499
|
+
* ```
|
|
4378
4500
|
*
|
|
4379
4501
|
* @since 2.0.0
|
|
4380
4502
|
* @category utils
|
|
@@ -4384,6 +4506,7 @@ export const intersperseAffixes: {
|
|
|
4384
4506
|
* Intersperse the specified element, also adding a prefix and a suffix.
|
|
4385
4507
|
*
|
|
4386
4508
|
* @example
|
|
4509
|
+
* ```ts
|
|
4387
4510
|
* import { Effect, Stream } from "effect"
|
|
4388
4511
|
*
|
|
4389
4512
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(
|
|
@@ -4403,6 +4526,7 @@ export const intersperseAffixes: {
|
|
|
4403
4526
|
* // ']'
|
|
4404
4527
|
* // ]
|
|
4405
4528
|
* // }
|
|
4529
|
+
* ```
|
|
4406
4530
|
*
|
|
4407
4531
|
* @since 2.0.0
|
|
4408
4532
|
* @category utils
|
|
@@ -4414,6 +4538,7 @@ export const intersperseAffixes: {
|
|
|
4414
4538
|
* Intersperse the specified element, also adding a prefix and a suffix.
|
|
4415
4539
|
*
|
|
4416
4540
|
* @example
|
|
4541
|
+
* ```ts
|
|
4417
4542
|
* import { Effect, Stream } from "effect"
|
|
4418
4543
|
*
|
|
4419
4544
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(
|
|
@@ -4433,6 +4558,7 @@ export const intersperseAffixes: {
|
|
|
4433
4558
|
* // ']'
|
|
4434
4559
|
* // ]
|
|
4435
4560
|
* // }
|
|
4561
|
+
* ```
|
|
4436
4562
|
*
|
|
4437
4563
|
* @since 2.0.0
|
|
4438
4564
|
* @category utils
|
|
@@ -4550,6 +4676,7 @@ export const interruptWhenDeferred: {
|
|
|
4550
4676
|
* f(f(f(a))), ...
|
|
4551
4677
|
*
|
|
4552
4678
|
* @example
|
|
4679
|
+
* ```ts
|
|
4553
4680
|
* import { Effect, Stream } from "effect"
|
|
4554
4681
|
*
|
|
4555
4682
|
* // An infinite Stream of numbers starting from 1 and incrementing
|
|
@@ -4557,6 +4684,7 @@ export const interruptWhenDeferred: {
|
|
|
4557
4684
|
*
|
|
4558
4685
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(10)))).then(console.log)
|
|
4559
4686
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }
|
|
4687
|
+
* ```
|
|
4560
4688
|
*
|
|
4561
4689
|
* @since 2.0.0
|
|
4562
4690
|
* @category constructors
|
|
@@ -4567,12 +4695,14 @@ export const iterate: <A>(value: A, next: (value: A) => A) => Stream<A> = intern
|
|
|
4567
4695
|
* Creates a stream from an sequence of values.
|
|
4568
4696
|
*
|
|
4569
4697
|
* @example
|
|
4698
|
+
* ```ts
|
|
4570
4699
|
* import { Effect, Stream } from "effect"
|
|
4571
4700
|
*
|
|
4572
4701
|
* const stream = Stream.make(1, 2, 3)
|
|
4573
4702
|
*
|
|
4574
4703
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4575
4704
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
4705
|
+
* ```
|
|
4576
4706
|
*
|
|
4577
4707
|
* @since 2.0.0
|
|
4578
4708
|
* @category constructors
|
|
@@ -4583,12 +4713,14 @@ export const make: <As extends Array<any>>(...as: As) => Stream<As[number]> = in
|
|
|
4583
4713
|
* Transforms the elements of this stream using the supplied function.
|
|
4584
4714
|
*
|
|
4585
4715
|
* @example
|
|
4716
|
+
* ```ts
|
|
4586
4717
|
* import { Effect, Stream } from "effect"
|
|
4587
4718
|
*
|
|
4588
4719
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4589
4720
|
*
|
|
4590
4721
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4591
4722
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4723
|
+
* ```
|
|
4592
4724
|
*
|
|
4593
4725
|
* @since 2.0.0
|
|
4594
4726
|
* @category mapping
|
|
@@ -4598,12 +4730,14 @@ export const map: {
|
|
|
4598
4730
|
* Transforms the elements of this stream using the supplied function.
|
|
4599
4731
|
*
|
|
4600
4732
|
* @example
|
|
4733
|
+
* ```ts
|
|
4601
4734
|
* import { Effect, Stream } from "effect"
|
|
4602
4735
|
*
|
|
4603
4736
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4604
4737
|
*
|
|
4605
4738
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4606
4739
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4740
|
+
* ```
|
|
4607
4741
|
*
|
|
4608
4742
|
* @since 2.0.0
|
|
4609
4743
|
* @category mapping
|
|
@@ -4613,12 +4747,14 @@ export const map: {
|
|
|
4613
4747
|
* Transforms the elements of this stream using the supplied function.
|
|
4614
4748
|
*
|
|
4615
4749
|
* @example
|
|
4750
|
+
* ```ts
|
|
4616
4751
|
* import { Effect, Stream } from "effect"
|
|
4617
4752
|
*
|
|
4618
4753
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4619
4754
|
*
|
|
4620
4755
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4621
4756
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4757
|
+
* ```
|
|
4622
4758
|
*
|
|
4623
4759
|
* @since 2.0.0
|
|
4624
4760
|
* @category mapping
|
|
@@ -4630,6 +4766,7 @@ export const map: {
|
|
|
4630
4766
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
4631
4767
|
*
|
|
4632
4768
|
* @example
|
|
4769
|
+
* ```ts
|
|
4633
4770
|
* import { Effect, Stream } from "effect"
|
|
4634
4771
|
*
|
|
4635
4772
|
* const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
|
|
@@ -4640,6 +4777,7 @@ export const map: {
|
|
|
4640
4777
|
* // console.log
|
|
4641
4778
|
* // )
|
|
4642
4779
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4780
|
+
* ```
|
|
4643
4781
|
*
|
|
4644
4782
|
* @since 2.0.0
|
|
4645
4783
|
* @category mapping
|
|
@@ -4649,6 +4787,7 @@ export const mapAccum: {
|
|
|
4649
4787
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
4650
4788
|
*
|
|
4651
4789
|
* @example
|
|
4790
|
+
* ```ts
|
|
4652
4791
|
* import { Effect, Stream } from "effect"
|
|
4653
4792
|
*
|
|
4654
4793
|
* const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
|
|
@@ -4659,6 +4798,7 @@ export const mapAccum: {
|
|
|
4659
4798
|
* // console.log
|
|
4660
4799
|
* // )
|
|
4661
4800
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4801
|
+
* ```
|
|
4662
4802
|
*
|
|
4663
4803
|
* @since 2.0.0
|
|
4664
4804
|
* @category mapping
|
|
@@ -4668,6 +4808,7 @@ export const mapAccum: {
|
|
|
4668
4808
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
4669
4809
|
*
|
|
4670
4810
|
* @example
|
|
4811
|
+
* ```ts
|
|
4671
4812
|
* import { Effect, Stream } from "effect"
|
|
4672
4813
|
*
|
|
4673
4814
|
* const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
|
|
@@ -4678,6 +4819,7 @@ export const mapAccum: {
|
|
|
4678
4819
|
* // console.log
|
|
4679
4820
|
* // )
|
|
4680
4821
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4822
|
+
* ```
|
|
4681
4823
|
*
|
|
4682
4824
|
* @since 2.0.0
|
|
4683
4825
|
* @category mapping
|
|
@@ -4805,6 +4947,7 @@ export const mapChunksEffect: {
|
|
|
4805
4947
|
* output of this stream.
|
|
4806
4948
|
*
|
|
4807
4949
|
* @example
|
|
4950
|
+
* ```ts
|
|
4808
4951
|
* import { Effect, Stream } from "effect"
|
|
4809
4952
|
*
|
|
4810
4953
|
* const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
|
|
@@ -4814,6 +4957,7 @@ export const mapChunksEffect: {
|
|
|
4814
4957
|
*
|
|
4815
4958
|
* // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4816
4959
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4960
|
+
* ```
|
|
4817
4961
|
*
|
|
4818
4962
|
* @since 2.0.0
|
|
4819
4963
|
* @category mapping
|
|
@@ -4824,6 +4968,7 @@ export const mapConcat: {
|
|
|
4824
4968
|
* output of this stream.
|
|
4825
4969
|
*
|
|
4826
4970
|
* @example
|
|
4971
|
+
* ```ts
|
|
4827
4972
|
* import { Effect, Stream } from "effect"
|
|
4828
4973
|
*
|
|
4829
4974
|
* const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
|
|
@@ -4833,6 +4978,7 @@ export const mapConcat: {
|
|
|
4833
4978
|
*
|
|
4834
4979
|
* // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4835
4980
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4981
|
+
* ```
|
|
4836
4982
|
*
|
|
4837
4983
|
* @since 2.0.0
|
|
4838
4984
|
* @category mapping
|
|
@@ -4843,6 +4989,7 @@ export const mapConcat: {
|
|
|
4843
4989
|
* output of this stream.
|
|
4844
4990
|
*
|
|
4845
4991
|
* @example
|
|
4992
|
+
* ```ts
|
|
4846
4993
|
* import { Effect, Stream } from "effect"
|
|
4847
4994
|
*
|
|
4848
4995
|
* const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
|
|
@@ -4852,6 +4999,7 @@ export const mapConcat: {
|
|
|
4852
4999
|
*
|
|
4853
5000
|
* // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4854
5001
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
5002
|
+
* ```
|
|
4855
5003
|
*
|
|
4856
5004
|
* @since 2.0.0
|
|
4857
5005
|
* @category mapping
|
|
@@ -4951,6 +5099,7 @@ export const mapConcatEffect: {
|
|
|
4951
5099
|
* Maps over elements of the stream with the specified effectful function.
|
|
4952
5100
|
*
|
|
4953
5101
|
* @example
|
|
5102
|
+
* ```ts
|
|
4954
5103
|
* import { Effect, Random, Stream } from "effect"
|
|
4955
5104
|
*
|
|
4956
5105
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4959,6 +5108,7 @@ export const mapConcatEffect: {
|
|
|
4959
5108
|
*
|
|
4960
5109
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4961
5110
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
5111
|
+
* ```
|
|
4962
5112
|
*
|
|
4963
5113
|
* @since 2.0.0
|
|
4964
5114
|
* @category mapping
|
|
@@ -4968,6 +5118,7 @@ export const mapEffect: {
|
|
|
4968
5118
|
* Maps over elements of the stream with the specified effectful function.
|
|
4969
5119
|
*
|
|
4970
5120
|
* @example
|
|
5121
|
+
* ```ts
|
|
4971
5122
|
* import { Effect, Random, Stream } from "effect"
|
|
4972
5123
|
*
|
|
4973
5124
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4976,6 +5127,7 @@ export const mapEffect: {
|
|
|
4976
5127
|
*
|
|
4977
5128
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4978
5129
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
5130
|
+
* ```
|
|
4979
5131
|
*
|
|
4980
5132
|
* @since 2.0.0
|
|
4981
5133
|
* @category mapping
|
|
@@ -4990,6 +5142,7 @@ export const mapEffect: {
|
|
|
4990
5142
|
* Maps over elements of the stream with the specified effectful function.
|
|
4991
5143
|
*
|
|
4992
5144
|
* @example
|
|
5145
|
+
* ```ts
|
|
4993
5146
|
* import { Effect, Random, Stream } from "effect"
|
|
4994
5147
|
*
|
|
4995
5148
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4998,6 +5151,7 @@ export const mapEffect: {
|
|
|
4998
5151
|
*
|
|
4999
5152
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5000
5153
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
5154
|
+
* ```
|
|
5001
5155
|
*
|
|
5002
5156
|
* @since 2.0.0
|
|
5003
5157
|
* @category mapping
|
|
@@ -5010,6 +5164,7 @@ export const mapEffect: {
|
|
|
5010
5164
|
* Maps over elements of the stream with the specified effectful function.
|
|
5011
5165
|
*
|
|
5012
5166
|
* @example
|
|
5167
|
+
* ```ts
|
|
5013
5168
|
* import { Effect, Random, Stream } from "effect"
|
|
5014
5169
|
*
|
|
5015
5170
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -5018,6 +5173,7 @@ export const mapEffect: {
|
|
|
5018
5173
|
*
|
|
5019
5174
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5020
5175
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
5176
|
+
* ```
|
|
5021
5177
|
*
|
|
5022
5178
|
* @since 2.0.0
|
|
5023
5179
|
* @category mapping
|
|
@@ -5033,6 +5189,7 @@ export const mapEffect: {
|
|
|
5033
5189
|
* Maps over elements of the stream with the specified effectful function.
|
|
5034
5190
|
*
|
|
5035
5191
|
* @example
|
|
5192
|
+
* ```ts
|
|
5036
5193
|
* import { Effect, Random, Stream } from "effect"
|
|
5037
5194
|
*
|
|
5038
5195
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -5041,6 +5198,7 @@ export const mapEffect: {
|
|
|
5041
5198
|
*
|
|
5042
5199
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5043
5200
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
5201
|
+
* ```
|
|
5044
5202
|
*
|
|
5045
5203
|
* @since 2.0.0
|
|
5046
5204
|
* @category mapping
|
|
@@ -5105,6 +5263,7 @@ export const mapErrorCause: {
|
|
|
5105
5263
|
* no termination strategy is specified.
|
|
5106
5264
|
*
|
|
5107
5265
|
* @example
|
|
5266
|
+
* ```ts
|
|
5108
5267
|
* import { Effect, Schedule, Stream } from "effect"
|
|
5109
5268
|
*
|
|
5110
5269
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -5118,6 +5277,7 @@ export const mapErrorCause: {
|
|
|
5118
5277
|
*
|
|
5119
5278
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5120
5279
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5280
|
+
* ```
|
|
5121
5281
|
*
|
|
5122
5282
|
* @since 2.0.0
|
|
5123
5283
|
* @category utils
|
|
@@ -5130,6 +5290,7 @@ export const merge: {
|
|
|
5130
5290
|
* no termination strategy is specified.
|
|
5131
5291
|
*
|
|
5132
5292
|
* @example
|
|
5293
|
+
* ```ts
|
|
5133
5294
|
* import { Effect, Schedule, Stream } from "effect"
|
|
5134
5295
|
*
|
|
5135
5296
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -5143,6 +5304,7 @@ export const merge: {
|
|
|
5143
5304
|
*
|
|
5144
5305
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5145
5306
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5307
|
+
* ```
|
|
5146
5308
|
*
|
|
5147
5309
|
* @since 2.0.0
|
|
5148
5310
|
* @category utils
|
|
@@ -5158,6 +5320,7 @@ export const merge: {
|
|
|
5158
5320
|
* no termination strategy is specified.
|
|
5159
5321
|
*
|
|
5160
5322
|
* @example
|
|
5323
|
+
* ```ts
|
|
5161
5324
|
* import { Effect, Schedule, Stream } from "effect"
|
|
5162
5325
|
*
|
|
5163
5326
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -5171,6 +5334,7 @@ export const merge: {
|
|
|
5171
5334
|
*
|
|
5172
5335
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5173
5336
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5337
|
+
* ```
|
|
5174
5338
|
*
|
|
5175
5339
|
* @since 2.0.0
|
|
5176
5340
|
* @category utils
|
|
@@ -5228,12 +5392,14 @@ export const mergeAll: {
|
|
|
5228
5392
|
* @since 3.8.5
|
|
5229
5393
|
*
|
|
5230
5394
|
* @example
|
|
5395
|
+
* ```ts
|
|
5231
5396
|
* import { Stream } from "effect"
|
|
5232
5397
|
* // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
|
|
5233
5398
|
* const res = Stream.mergeWithTag({
|
|
5234
5399
|
* a: Stream.make(0),
|
|
5235
5400
|
* b: Stream.make("")
|
|
5236
5401
|
* }, { concurrency: "unbounded" })
|
|
5402
|
+
* ```
|
|
5237
5403
|
*/
|
|
5238
5404
|
export const mergeWithTag: {
|
|
5239
5405
|
/**
|
|
@@ -5242,12 +5408,14 @@ export const mergeWithTag: {
|
|
|
5242
5408
|
* @since 3.8.5
|
|
5243
5409
|
*
|
|
5244
5410
|
* @example
|
|
5411
|
+
* ```ts
|
|
5245
5412
|
* import { Stream } from "effect"
|
|
5246
5413
|
* // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
|
|
5247
5414
|
* const res = Stream.mergeWithTag({
|
|
5248
5415
|
* a: Stream.make(0),
|
|
5249
5416
|
* b: Stream.make("")
|
|
5250
5417
|
* }, { concurrency: "unbounded" })
|
|
5418
|
+
* ```
|
|
5251
5419
|
*/
|
|
5252
5420
|
<S extends { [k in string]: Stream<any, any, any> }>(
|
|
5253
5421
|
streams: S,
|
|
@@ -5266,12 +5434,14 @@ export const mergeWithTag: {
|
|
|
5266
5434
|
* @since 3.8.5
|
|
5267
5435
|
*
|
|
5268
5436
|
* @example
|
|
5437
|
+
* ```ts
|
|
5269
5438
|
* import { Stream } from "effect"
|
|
5270
5439
|
* // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
|
|
5271
5440
|
* const res = Stream.mergeWithTag({
|
|
5272
5441
|
* a: Stream.make(0),
|
|
5273
5442
|
* b: Stream.make("")
|
|
5274
5443
|
* }, { concurrency: "unbounded" })
|
|
5444
|
+
* ```
|
|
5275
5445
|
*/
|
|
5276
5446
|
(
|
|
5277
5447
|
options: {
|
|
@@ -5293,6 +5463,7 @@ export const mergeWithTag: {
|
|
|
5293
5463
|
* no termination strategy is specified.
|
|
5294
5464
|
*
|
|
5295
5465
|
* @example
|
|
5466
|
+
* ```ts
|
|
5296
5467
|
* import { Effect, Schedule, Stream } from "effect"
|
|
5297
5468
|
*
|
|
5298
5469
|
* const s1 = Stream.make("1", "2", "3").pipe(
|
|
@@ -5309,6 +5480,7 @@ export const mergeWithTag: {
|
|
|
5309
5480
|
*
|
|
5310
5481
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5311
5482
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5483
|
+
* ```
|
|
5312
5484
|
*
|
|
5313
5485
|
* @since 2.0.0
|
|
5314
5486
|
* @category utils
|
|
@@ -5322,6 +5494,7 @@ export const mergeWith: {
|
|
|
5322
5494
|
* no termination strategy is specified.
|
|
5323
5495
|
*
|
|
5324
5496
|
* @example
|
|
5497
|
+
* ```ts
|
|
5325
5498
|
* import { Effect, Schedule, Stream } from "effect"
|
|
5326
5499
|
*
|
|
5327
5500
|
* const s1 = Stream.make("1", "2", "3").pipe(
|
|
@@ -5338,6 +5511,7 @@ export const mergeWith: {
|
|
|
5338
5511
|
*
|
|
5339
5512
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5340
5513
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5514
|
+
* ```
|
|
5341
5515
|
*
|
|
5342
5516
|
* @since 2.0.0
|
|
5343
5517
|
* @category utils
|
|
@@ -5358,6 +5532,7 @@ export const mergeWith: {
|
|
|
5358
5532
|
* no termination strategy is specified.
|
|
5359
5533
|
*
|
|
5360
5534
|
* @example
|
|
5535
|
+
* ```ts
|
|
5361
5536
|
* import { Effect, Schedule, Stream } from "effect"
|
|
5362
5537
|
*
|
|
5363
5538
|
* const s1 = Stream.make("1", "2", "3").pipe(
|
|
@@ -5374,6 +5549,7 @@ export const mergeWith: {
|
|
|
5374
5549
|
*
|
|
5375
5550
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5376
5551
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5552
|
+
* ```
|
|
5377
5553
|
*
|
|
5378
5554
|
* @since 2.0.0
|
|
5379
5555
|
* @category utils
|
|
@@ -5490,6 +5666,7 @@ export const never: Stream<never> = internal.never
|
|
|
5490
5666
|
* Adds an effect to be executed at the end of the stream.
|
|
5491
5667
|
*
|
|
5492
5668
|
* @example
|
|
5669
|
+
* ```ts
|
|
5493
5670
|
* import { Console, Effect, Stream } from "effect"
|
|
5494
5671
|
*
|
|
5495
5672
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5504,6 +5681,7 @@ export const never: Stream<never> = internal.never
|
|
|
5504
5681
|
* // after mapping: 6
|
|
5505
5682
|
* // Stream ended
|
|
5506
5683
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5684
|
+
* ```
|
|
5507
5685
|
*
|
|
5508
5686
|
* @since 3.6.0
|
|
5509
5687
|
* @category sequencing
|
|
@@ -5513,6 +5691,7 @@ export const onEnd: {
|
|
|
5513
5691
|
* Adds an effect to be executed at the end of the stream.
|
|
5514
5692
|
*
|
|
5515
5693
|
* @example
|
|
5694
|
+
* ```ts
|
|
5516
5695
|
* import { Console, Effect, Stream } from "effect"
|
|
5517
5696
|
*
|
|
5518
5697
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5527,6 +5706,7 @@ export const onEnd: {
|
|
|
5527
5706
|
* // after mapping: 6
|
|
5528
5707
|
* // Stream ended
|
|
5529
5708
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5709
|
+
* ```
|
|
5530
5710
|
*
|
|
5531
5711
|
* @since 3.6.0
|
|
5532
5712
|
* @category sequencing
|
|
@@ -5536,6 +5716,7 @@ export const onEnd: {
|
|
|
5536
5716
|
* Adds an effect to be executed at the end of the stream.
|
|
5537
5717
|
*
|
|
5538
5718
|
* @example
|
|
5719
|
+
* ```ts
|
|
5539
5720
|
* import { Console, Effect, Stream } from "effect"
|
|
5540
5721
|
*
|
|
5541
5722
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5550,6 +5731,7 @@ export const onEnd: {
|
|
|
5550
5731
|
* // after mapping: 6
|
|
5551
5732
|
* // Stream ended
|
|
5552
5733
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5734
|
+
* ```
|
|
5553
5735
|
*
|
|
5554
5736
|
* @since 3.6.0
|
|
5555
5737
|
* @category sequencing
|
|
@@ -5624,6 +5806,7 @@ export const onDone: {
|
|
|
5624
5806
|
* Adds an effect to be executed at the start of the stream.
|
|
5625
5807
|
*
|
|
5626
5808
|
* @example
|
|
5809
|
+
* ```ts
|
|
5627
5810
|
* import { Console, Effect, Stream } from "effect"
|
|
5628
5811
|
*
|
|
5629
5812
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5638,6 +5821,7 @@ export const onDone: {
|
|
|
5638
5821
|
* // after mapping: 4
|
|
5639
5822
|
* // after mapping: 6
|
|
5640
5823
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5824
|
+
* ```
|
|
5641
5825
|
*
|
|
5642
5826
|
* @since 3.6.0
|
|
5643
5827
|
* @category sequencing
|
|
@@ -5647,6 +5831,7 @@ export const onStart: {
|
|
|
5647
5831
|
* Adds an effect to be executed at the start of the stream.
|
|
5648
5832
|
*
|
|
5649
5833
|
* @example
|
|
5834
|
+
* ```ts
|
|
5650
5835
|
* import { Console, Effect, Stream } from "effect"
|
|
5651
5836
|
*
|
|
5652
5837
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5661,6 +5846,7 @@ export const onStart: {
|
|
|
5661
5846
|
* // after mapping: 4
|
|
5662
5847
|
* // after mapping: 6
|
|
5663
5848
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5849
|
+
* ```
|
|
5664
5850
|
*
|
|
5665
5851
|
* @since 3.6.0
|
|
5666
5852
|
* @category sequencing
|
|
@@ -5670,6 +5856,7 @@ export const onStart: {
|
|
|
5670
5856
|
* Adds an effect to be executed at the start of the stream.
|
|
5671
5857
|
*
|
|
5672
5858
|
* @example
|
|
5859
|
+
* ```ts
|
|
5673
5860
|
* import { Console, Effect, Stream } from "effect"
|
|
5674
5861
|
*
|
|
5675
5862
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5684,6 +5871,7 @@ export const onStart: {
|
|
|
5684
5871
|
* // after mapping: 4
|
|
5685
5872
|
* // after mapping: 6
|
|
5686
5873
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5874
|
+
* ```
|
|
5687
5875
|
*
|
|
5688
5876
|
* @since 3.6.0
|
|
5689
5877
|
* @category sequencing
|
|
@@ -5916,6 +6104,7 @@ export const orElseSucceed: {
|
|
|
5916
6104
|
* APIs, hence the name.
|
|
5917
6105
|
*
|
|
5918
6106
|
* @example
|
|
6107
|
+
* ```ts
|
|
5919
6108
|
* import { Effect, Option, Stream } from "effect"
|
|
5920
6109
|
*
|
|
5921
6110
|
* const stream = Stream.paginate(0, (n) => [
|
|
@@ -5925,6 +6114,7 @@ export const orElseSucceed: {
|
|
|
5925
6114
|
*
|
|
5926
6115
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5927
6116
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3 ] }
|
|
6117
|
+
* ```
|
|
5928
6118
|
*
|
|
5929
6119
|
* @since 2.0.0
|
|
5930
6120
|
* @category constructors
|
|
@@ -5972,11 +6162,12 @@ export const paginateEffect: <S, A, E, R>(
|
|
|
5972
6162
|
|
|
5973
6163
|
/**
|
|
5974
6164
|
* Partition a stream using a predicate. The first stream will contain all
|
|
5975
|
-
* element evaluated to
|
|
5976
|
-
* evaluated to
|
|
6165
|
+
* element evaluated to false and the second one will contain all element
|
|
6166
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
5977
6167
|
* further than the slower one.
|
|
5978
6168
|
*
|
|
5979
6169
|
* @example
|
|
6170
|
+
* ```ts
|
|
5980
6171
|
* import { Effect, Stream } from "effect"
|
|
5981
6172
|
*
|
|
5982
6173
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -5985,15 +6176,16 @@ export const paginateEffect: <S, A, E, R>(
|
|
|
5985
6176
|
*
|
|
5986
6177
|
* const program = Effect.scoped(
|
|
5987
6178
|
* Effect.gen(function*() {
|
|
5988
|
-
* const [
|
|
5989
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
6179
|
+
* const [odds, evens] = yield* partition
|
|
5990
6180
|
* console.log(yield* Stream.runCollect(odds))
|
|
6181
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5991
6182
|
* })
|
|
5992
6183
|
* )
|
|
5993
6184
|
*
|
|
5994
6185
|
* // Effect.runPromise(program)
|
|
5995
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5996
6186
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6187
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6188
|
+
* ```
|
|
5997
6189
|
*
|
|
5998
6190
|
* @since 2.0.0
|
|
5999
6191
|
* @category utils
|
|
@@ -6001,11 +6193,12 @@ export const paginateEffect: <S, A, E, R>(
|
|
|
6001
6193
|
export const partition: {
|
|
6002
6194
|
/**
|
|
6003
6195
|
* Partition a stream using a predicate. The first stream will contain all
|
|
6004
|
-
* element evaluated to
|
|
6005
|
-
* evaluated to
|
|
6196
|
+
* element evaluated to false and the second one will contain all element
|
|
6197
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
6006
6198
|
* further than the slower one.
|
|
6007
6199
|
*
|
|
6008
6200
|
* @example
|
|
6201
|
+
* ```ts
|
|
6009
6202
|
* import { Effect, Stream } from "effect"
|
|
6010
6203
|
*
|
|
6011
6204
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -6014,15 +6207,16 @@ export const partition: {
|
|
|
6014
6207
|
*
|
|
6015
6208
|
* const program = Effect.scoped(
|
|
6016
6209
|
* Effect.gen(function*() {
|
|
6017
|
-
* const [
|
|
6018
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
6210
|
+
* const [odds, evens] = yield* partition
|
|
6019
6211
|
* console.log(yield* Stream.runCollect(odds))
|
|
6212
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
6020
6213
|
* })
|
|
6021
6214
|
* )
|
|
6022
6215
|
*
|
|
6023
6216
|
* // Effect.runPromise(program)
|
|
6024
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6025
6217
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6218
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6219
|
+
* ```
|
|
6026
6220
|
*
|
|
6027
6221
|
* @since 2.0.0
|
|
6028
6222
|
* @category utils
|
|
@@ -6035,11 +6229,12 @@ export const partition: {
|
|
|
6035
6229
|
) => Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>
|
|
6036
6230
|
/**
|
|
6037
6231
|
* Partition a stream using a predicate. The first stream will contain all
|
|
6038
|
-
* element evaluated to
|
|
6039
|
-
* evaluated to
|
|
6232
|
+
* element evaluated to false and the second one will contain all element
|
|
6233
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
6040
6234
|
* further than the slower one.
|
|
6041
6235
|
*
|
|
6042
6236
|
* @example
|
|
6237
|
+
* ```ts
|
|
6043
6238
|
* import { Effect, Stream } from "effect"
|
|
6044
6239
|
*
|
|
6045
6240
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -6048,15 +6243,16 @@ export const partition: {
|
|
|
6048
6243
|
*
|
|
6049
6244
|
* const program = Effect.scoped(
|
|
6050
6245
|
* Effect.gen(function*() {
|
|
6051
|
-
* const [
|
|
6052
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
6246
|
+
* const [odds, evens] = yield* partition
|
|
6053
6247
|
* console.log(yield* Stream.runCollect(odds))
|
|
6248
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
6054
6249
|
* })
|
|
6055
6250
|
* )
|
|
6056
6251
|
*
|
|
6057
6252
|
* // Effect.runPromise(program)
|
|
6058
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6059
6253
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6254
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6255
|
+
* ```
|
|
6060
6256
|
*
|
|
6061
6257
|
* @since 2.0.0
|
|
6062
6258
|
* @category utils
|
|
@@ -6069,11 +6265,12 @@ export const partition: {
|
|
|
6069
6265
|
) => Effect.Effect<[excluded: Stream<A, E, never>, satisfying: Stream<A, E, never>], E, Scope.Scope | R>
|
|
6070
6266
|
/**
|
|
6071
6267
|
* Partition a stream using a predicate. The first stream will contain all
|
|
6072
|
-
* element evaluated to
|
|
6073
|
-
* evaluated to
|
|
6268
|
+
* element evaluated to false and the second one will contain all element
|
|
6269
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
6074
6270
|
* further than the slower one.
|
|
6075
6271
|
*
|
|
6076
6272
|
* @example
|
|
6273
|
+
* ```ts
|
|
6077
6274
|
* import { Effect, Stream } from "effect"
|
|
6078
6275
|
*
|
|
6079
6276
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -6082,15 +6279,16 @@ export const partition: {
|
|
|
6082
6279
|
*
|
|
6083
6280
|
* const program = Effect.scoped(
|
|
6084
6281
|
* Effect.gen(function*() {
|
|
6085
|
-
* const [
|
|
6086
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
6282
|
+
* const [odds, evens] = yield* partition
|
|
6087
6283
|
* console.log(yield* Stream.runCollect(odds))
|
|
6284
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
6088
6285
|
* })
|
|
6089
6286
|
* )
|
|
6090
6287
|
*
|
|
6091
6288
|
* // Effect.runPromise(program)
|
|
6092
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6093
6289
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6290
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6291
|
+
* ```
|
|
6094
6292
|
*
|
|
6095
6293
|
* @since 2.0.0
|
|
6096
6294
|
* @category utils
|
|
@@ -6102,11 +6300,12 @@ export const partition: {
|
|
|
6102
6300
|
): Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>
|
|
6103
6301
|
/**
|
|
6104
6302
|
* Partition a stream using a predicate. The first stream will contain all
|
|
6105
|
-
* element evaluated to
|
|
6106
|
-
* evaluated to
|
|
6303
|
+
* element evaluated to false and the second one will contain all element
|
|
6304
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
6107
6305
|
* further than the slower one.
|
|
6108
6306
|
*
|
|
6109
6307
|
* @example
|
|
6308
|
+
* ```ts
|
|
6110
6309
|
* import { Effect, Stream } from "effect"
|
|
6111
6310
|
*
|
|
6112
6311
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -6115,15 +6314,16 @@ export const partition: {
|
|
|
6115
6314
|
*
|
|
6116
6315
|
* const program = Effect.scoped(
|
|
6117
6316
|
* Effect.gen(function*() {
|
|
6118
|
-
* const [
|
|
6119
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
6317
|
+
* const [odds, evens] = yield* partition
|
|
6120
6318
|
* console.log(yield* Stream.runCollect(odds))
|
|
6319
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
6121
6320
|
* })
|
|
6122
6321
|
* )
|
|
6123
6322
|
*
|
|
6124
6323
|
* // Effect.runPromise(program)
|
|
6125
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6126
6324
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6325
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
6326
|
+
* ```
|
|
6127
6327
|
*
|
|
6128
6328
|
* @since 2.0.0
|
|
6129
6329
|
* @category utils
|
|
@@ -6140,6 +6340,7 @@ export const partition: {
|
|
|
6140
6340
|
* up to buffer elements further than the slower one.
|
|
6141
6341
|
*
|
|
6142
6342
|
* @example
|
|
6343
|
+
* ```ts
|
|
6143
6344
|
* import { Effect, Either, Stream } from "effect"
|
|
6144
6345
|
*
|
|
6145
6346
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -6160,6 +6361,7 @@ export const partition: {
|
|
|
6160
6361
|
* // Effect.runPromise(program)
|
|
6161
6362
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
6162
6363
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6364
|
+
* ```
|
|
6163
6365
|
*
|
|
6164
6366
|
* @since 2.0.0
|
|
6165
6367
|
* @category utils
|
|
@@ -6170,6 +6372,7 @@ export const partitionEither: {
|
|
|
6170
6372
|
* up to buffer elements further than the slower one.
|
|
6171
6373
|
*
|
|
6172
6374
|
* @example
|
|
6375
|
+
* ```ts
|
|
6173
6376
|
* import { Effect, Either, Stream } from "effect"
|
|
6174
6377
|
*
|
|
6175
6378
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -6190,6 +6393,7 @@ export const partitionEither: {
|
|
|
6190
6393
|
* // Effect.runPromise(program)
|
|
6191
6394
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
6192
6395
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6396
|
+
* ```
|
|
6193
6397
|
*
|
|
6194
6398
|
* @since 2.0.0
|
|
6195
6399
|
* @category utils
|
|
@@ -6205,6 +6409,7 @@ export const partitionEither: {
|
|
|
6205
6409
|
* up to buffer elements further than the slower one.
|
|
6206
6410
|
*
|
|
6207
6411
|
* @example
|
|
6412
|
+
* ```ts
|
|
6208
6413
|
* import { Effect, Either, Stream } from "effect"
|
|
6209
6414
|
*
|
|
6210
6415
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -6225,6 +6430,7 @@ export const partitionEither: {
|
|
|
6225
6430
|
* // Effect.runPromise(program)
|
|
6226
6431
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
6227
6432
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
6433
|
+
* ```
|
|
6228
6434
|
*
|
|
6229
6435
|
* @since 2.0.0
|
|
6230
6436
|
* @category utils
|
|
@@ -6596,6 +6802,7 @@ export const provideSomeLayer: {
|
|
|
6596
6802
|
* Any upstream failures will cause the returned stream to fail.
|
|
6597
6803
|
*
|
|
6598
6804
|
* @example
|
|
6805
|
+
* ```ts
|
|
6599
6806
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6600
6807
|
*
|
|
6601
6808
|
* const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
|
|
@@ -6612,6 +6819,7 @@ export const provideSomeLayer: {
|
|
|
6612
6819
|
* // 3
|
|
6613
6820
|
* // 4
|
|
6614
6821
|
* // 5
|
|
6822
|
+
* ```
|
|
6615
6823
|
* @since 3.7.0
|
|
6616
6824
|
* @category racing
|
|
6617
6825
|
*/
|
|
@@ -6623,6 +6831,7 @@ export const race: {
|
|
|
6623
6831
|
* Any upstream failures will cause the returned stream to fail.
|
|
6624
6832
|
*
|
|
6625
6833
|
* @example
|
|
6834
|
+
* ```ts
|
|
6626
6835
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6627
6836
|
*
|
|
6628
6837
|
* const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
|
|
@@ -6639,6 +6848,7 @@ export const race: {
|
|
|
6639
6848
|
* // 3
|
|
6640
6849
|
* // 4
|
|
6641
6850
|
* // 5
|
|
6851
|
+
* ```
|
|
6642
6852
|
* @since 3.7.0
|
|
6643
6853
|
* @category racing
|
|
6644
6854
|
*/
|
|
@@ -6650,6 +6860,7 @@ export const race: {
|
|
|
6650
6860
|
* Any upstream failures will cause the returned stream to fail.
|
|
6651
6861
|
*
|
|
6652
6862
|
* @example
|
|
6863
|
+
* ```ts
|
|
6653
6864
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6654
6865
|
*
|
|
6655
6866
|
* const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
|
|
@@ -6666,6 +6877,7 @@ export const race: {
|
|
|
6666
6877
|
* // 3
|
|
6667
6878
|
* // 4
|
|
6668
6879
|
* // 5
|
|
6880
|
+
* ```
|
|
6669
6881
|
* @since 3.7.0
|
|
6670
6882
|
* @category racing
|
|
6671
6883
|
*/
|
|
@@ -6679,6 +6891,7 @@ export const race: {
|
|
|
6679
6891
|
* Any upstream failures will cause the returned stream to fail.
|
|
6680
6892
|
*
|
|
6681
6893
|
* @example
|
|
6894
|
+
* ```ts
|
|
6682
6895
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6683
6896
|
*
|
|
6684
6897
|
* const stream = Stream.raceAll(
|
|
@@ -6695,6 +6908,7 @@ export const race: {
|
|
|
6695
6908
|
* // 3
|
|
6696
6909
|
* // 4
|
|
6697
6910
|
* // 5
|
|
6911
|
+
* ```
|
|
6698
6912
|
* @since 3.5.0
|
|
6699
6913
|
* @category racing
|
|
6700
6914
|
*/
|
|
@@ -6710,6 +6924,7 @@ export const raceAll: <S extends ReadonlyArray<Stream<any, any, any>>>(
|
|
|
6710
6924
|
* Constructs a stream from a range of integers, including both endpoints.
|
|
6711
6925
|
*
|
|
6712
6926
|
* @example
|
|
6927
|
+
* ```ts
|
|
6713
6928
|
* import { Effect, Stream } from "effect"
|
|
6714
6929
|
*
|
|
6715
6930
|
* // A Stream with a range of numbers from 1 to 5
|
|
@@ -6717,6 +6932,7 @@ export const raceAll: <S extends ReadonlyArray<Stream<any, any, any>>>(
|
|
|
6717
6932
|
*
|
|
6718
6933
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
6719
6934
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
6935
|
+
* ```
|
|
6720
6936
|
*
|
|
6721
6937
|
* @since 2.0.0
|
|
6722
6938
|
* @category constructors
|
|
@@ -6810,12 +7026,14 @@ export const refineOrDieWith: {
|
|
|
6810
7026
|
* execute normally, and then repeat again according to the provided schedule.
|
|
6811
7027
|
*
|
|
6812
7028
|
* @example
|
|
7029
|
+
* ```ts
|
|
6813
7030
|
* import { Effect, Schedule, Stream } from "effect"
|
|
6814
7031
|
*
|
|
6815
7032
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6816
7033
|
*
|
|
6817
7034
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6818
7035
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
7036
|
+
* ```
|
|
6819
7037
|
*
|
|
6820
7038
|
* @since 2.0.0
|
|
6821
7039
|
* @category utils
|
|
@@ -6826,12 +7044,14 @@ export const repeat: {
|
|
|
6826
7044
|
* execute normally, and then repeat again according to the provided schedule.
|
|
6827
7045
|
*
|
|
6828
7046
|
* @example
|
|
7047
|
+
* ```ts
|
|
6829
7048
|
* import { Effect, Schedule, Stream } from "effect"
|
|
6830
7049
|
*
|
|
6831
7050
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6832
7051
|
*
|
|
6833
7052
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6834
7053
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
7054
|
+
* ```
|
|
6835
7055
|
*
|
|
6836
7056
|
* @since 2.0.0
|
|
6837
7057
|
* @category utils
|
|
@@ -6842,12 +7062,14 @@ export const repeat: {
|
|
|
6842
7062
|
* execute normally, and then repeat again according to the provided schedule.
|
|
6843
7063
|
*
|
|
6844
7064
|
* @example
|
|
7065
|
+
* ```ts
|
|
6845
7066
|
* import { Effect, Schedule, Stream } from "effect"
|
|
6846
7067
|
*
|
|
6847
7068
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6848
7069
|
*
|
|
6849
7070
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6850
7071
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
7072
|
+
* ```
|
|
6851
7073
|
*
|
|
6852
7074
|
* @since 2.0.0
|
|
6853
7075
|
* @category utils
|
|
@@ -6860,12 +7082,14 @@ export const repeat: {
|
|
|
6860
7082
|
* forever.
|
|
6861
7083
|
*
|
|
6862
7084
|
* @example
|
|
7085
|
+
* ```ts
|
|
6863
7086
|
* import { Effect, Random, Stream } from "effect"
|
|
6864
7087
|
*
|
|
6865
7088
|
* const stream = Stream.repeatEffect(Random.nextInt)
|
|
6866
7089
|
*
|
|
6867
7090
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6868
7091
|
* // Example Output: { _id: 'Chunk', values: [ 3891571149, 4239494205, 2352981603, 2339111046, 1488052210 ] }
|
|
7092
|
+
* ```
|
|
6869
7093
|
*
|
|
6870
7094
|
* @since 2.0.0
|
|
6871
7095
|
* @category constructors
|
|
@@ -6898,6 +7122,7 @@ export const repeatEffectChunkOption: <A, E, R>(
|
|
|
6898
7122
|
* with `None`.
|
|
6899
7123
|
*
|
|
6900
7124
|
* @example
|
|
7125
|
+
* ```ts
|
|
6901
7126
|
* // In this example, we're draining an Iterator to create a stream from it
|
|
6902
7127
|
* import { Stream, Effect, Option } from "effect"
|
|
6903
7128
|
*
|
|
@@ -6912,6 +7137,7 @@ export const repeatEffectChunkOption: <A, E, R>(
|
|
|
6912
7137
|
* })
|
|
6913
7138
|
* )
|
|
6914
7139
|
* )
|
|
7140
|
+
* ```
|
|
6915
7141
|
*
|
|
6916
7142
|
* @since 2.0.0
|
|
6917
7143
|
* @category constructors
|
|
@@ -7061,12 +7287,14 @@ export const repeatElementsWith: {
|
|
|
7061
7287
|
* Repeats the provided value infinitely.
|
|
7062
7288
|
*
|
|
7063
7289
|
* @example
|
|
7290
|
+
* ```ts
|
|
7064
7291
|
* import { Effect, Stream } from "effect"
|
|
7065
7292
|
*
|
|
7066
7293
|
* const stream = Stream.repeatValue(0)
|
|
7067
7294
|
*
|
|
7068
7295
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
7069
7296
|
* // { _id: 'Chunk', values: [ 0, 0, 0, 0, 0 ] }
|
|
7297
|
+
* ```
|
|
7070
7298
|
*
|
|
7071
7299
|
* @since 2.0.0
|
|
7072
7300
|
* @category constructors
|
|
@@ -7192,8 +7420,7 @@ export const run: {
|
|
|
7192
7420
|
* @since 2.0.0
|
|
7193
7421
|
* @category destructors
|
|
7194
7422
|
*/
|
|
7195
|
-
export const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk.Chunk<A>, E,
|
|
7196
|
-
internal.runCollect
|
|
7423
|
+
export const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk.Chunk<A>, E, R> = internal.runCollect
|
|
7197
7424
|
|
|
7198
7425
|
/**
|
|
7199
7426
|
* Runs the stream and emits the number of elements processed
|
|
@@ -7201,8 +7428,7 @@ export const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk
|
|
|
7201
7428
|
* @since 2.0.0
|
|
7202
7429
|
* @category destructors
|
|
7203
7430
|
*/
|
|
7204
|
-
export const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number, E,
|
|
7205
|
-
internal.runCount
|
|
7431
|
+
export const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number, E, R> = internal.runCount
|
|
7206
7432
|
|
|
7207
7433
|
/**
|
|
7208
7434
|
* Runs the stream only for its effects. The emitted elements are discarded.
|
|
@@ -7210,8 +7436,7 @@ export const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number,
|
|
|
7210
7436
|
* @since 2.0.0
|
|
7211
7437
|
* @category destructors
|
|
7212
7438
|
*/
|
|
7213
|
-
export const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E,
|
|
7214
|
-
internal.runDrain
|
|
7439
|
+
export const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E, R> = internal.runDrain
|
|
7215
7440
|
|
|
7216
7441
|
/**
|
|
7217
7442
|
* Executes a pure fold over the stream of values - reduces all elements in
|
|
@@ -7228,7 +7453,7 @@ export const runFold: {
|
|
|
7228
7453
|
* @since 2.0.0
|
|
7229
7454
|
* @category destructors
|
|
7230
7455
|
*/
|
|
7231
|
-
<S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E,
|
|
7456
|
+
<S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>
|
|
7232
7457
|
/**
|
|
7233
7458
|
* Executes a pure fold over the stream of values - reduces all elements in
|
|
7234
7459
|
* the stream to a value of type `S`.
|
|
@@ -7236,7 +7461,7 @@ export const runFold: {
|
|
|
7236
7461
|
* @since 2.0.0
|
|
7237
7462
|
* @category destructors
|
|
7238
7463
|
*/
|
|
7239
|
-
<A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E,
|
|
7464
|
+
<A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, R>
|
|
7240
7465
|
} = internal.runFold
|
|
7241
7466
|
|
|
7242
7467
|
/**
|
|
@@ -7343,11 +7568,7 @@ export const runFoldWhile: {
|
|
|
7343
7568
|
* @since 2.0.0
|
|
7344
7569
|
* @category destructors
|
|
7345
7570
|
*/
|
|
7346
|
-
<S, A>(
|
|
7347
|
-
s: S,
|
|
7348
|
-
cont: Predicate<S>,
|
|
7349
|
-
f: (s: S, a: A) => S
|
|
7350
|
-
): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, Exclude<R, Scope.Scope>>
|
|
7571
|
+
<S, A>(s: S, cont: Predicate<S>, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>
|
|
7351
7572
|
/**
|
|
7352
7573
|
* Reduces the elements in the stream to a value of type `S`. Stops the fold
|
|
7353
7574
|
* early when the condition is not fulfilled. Example:
|
|
@@ -7355,12 +7576,7 @@ export const runFoldWhile: {
|
|
|
7355
7576
|
* @since 2.0.0
|
|
7356
7577
|
* @category destructors
|
|
7357
7578
|
*/
|
|
7358
|
-
<A, E, R, S>(
|
|
7359
|
-
self: Stream<A, E, R>,
|
|
7360
|
-
s: S,
|
|
7361
|
-
cont: Predicate<S>,
|
|
7362
|
-
f: (s: S, a: A) => S
|
|
7363
|
-
): Effect.Effect<S, E, Exclude<R, Scope.Scope>>
|
|
7579
|
+
<A, E, R, S>(self: Stream<A, E, R>, s: S, cont: Predicate<S>, f: (s: S, a: A) => S): Effect.Effect<S, E, R>
|
|
7364
7580
|
} = internal.runFoldWhile
|
|
7365
7581
|
|
|
7366
7582
|
/**
|
|
@@ -7852,12 +8068,14 @@ export const runSum: <E, R>(self: Stream<number, E, R>) => Effect.Effect<number,
|
|
|
7852
8068
|
* intermediate results of type `S` given an initial S.
|
|
7853
8069
|
*
|
|
7854
8070
|
* @example
|
|
8071
|
+
* ```ts
|
|
7855
8072
|
* import { Effect, Stream } from "effect"
|
|
7856
8073
|
*
|
|
7857
8074
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7858
8075
|
*
|
|
7859
8076
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7860
8077
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
8078
|
+
* ```
|
|
7861
8079
|
*
|
|
7862
8080
|
* @since 2.0.0
|
|
7863
8081
|
* @category utils
|
|
@@ -7868,12 +8086,14 @@ export const scan: {
|
|
|
7868
8086
|
* intermediate results of type `S` given an initial S.
|
|
7869
8087
|
*
|
|
7870
8088
|
* @example
|
|
8089
|
+
* ```ts
|
|
7871
8090
|
* import { Effect, Stream } from "effect"
|
|
7872
8091
|
*
|
|
7873
8092
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7874
8093
|
*
|
|
7875
8094
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7876
8095
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
8096
|
+
* ```
|
|
7877
8097
|
*
|
|
7878
8098
|
* @since 2.0.0
|
|
7879
8099
|
* @category utils
|
|
@@ -7884,12 +8104,14 @@ export const scan: {
|
|
|
7884
8104
|
* intermediate results of type `S` given an initial S.
|
|
7885
8105
|
*
|
|
7886
8106
|
* @example
|
|
8107
|
+
* ```ts
|
|
7887
8108
|
* import { Effect, Stream } from "effect"
|
|
7888
8109
|
*
|
|
7889
8110
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7890
8111
|
*
|
|
7891
8112
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7892
8113
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
8114
|
+
* ```
|
|
7893
8115
|
*
|
|
7894
8116
|
* @since 2.0.0
|
|
7895
8117
|
* @category utils
|
|
@@ -8064,6 +8286,7 @@ export const scheduleWith: {
|
|
|
8064
8286
|
* Creates a single-valued stream from a scoped resource.
|
|
8065
8287
|
*
|
|
8066
8288
|
* @example
|
|
8289
|
+
* ```ts
|
|
8067
8290
|
* import { Console, Effect, Stream } from "effect"
|
|
8068
8291
|
*
|
|
8069
8292
|
* // Creating a single-valued stream from a scoped resource
|
|
@@ -8080,6 +8303,7 @@ export const scheduleWith: {
|
|
|
8080
8303
|
* // use
|
|
8081
8304
|
* // release
|
|
8082
8305
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
8306
|
+
* ```
|
|
8083
8307
|
*
|
|
8084
8308
|
* @since 2.0.0
|
|
8085
8309
|
* @category constructors
|
|
@@ -8087,6 +8311,17 @@ export const scheduleWith: {
|
|
|
8087
8311
|
export const scoped: <A, E, R>(effect: Effect.Effect<A, E, R>) => Stream<A, E, Exclude<R, Scope.Scope>> =
|
|
8088
8312
|
internal.scoped
|
|
8089
8313
|
|
|
8314
|
+
/**
|
|
8315
|
+
* Use a function that receives a scope and returns an effect to emit an output
|
|
8316
|
+
* element. The output element will be the result of the returned effect, if
|
|
8317
|
+
* successful.
|
|
8318
|
+
*
|
|
8319
|
+
* @since 3.11.0
|
|
8320
|
+
* @category constructors
|
|
8321
|
+
*/
|
|
8322
|
+
export const scopedWith: <A, E, R>(f: (scope: Scope.Scope) => Effect.Effect<A, E, R>) => Stream<A, E, R> =
|
|
8323
|
+
internal.scopedWith
|
|
8324
|
+
|
|
8090
8325
|
/**
|
|
8091
8326
|
* Emits a sliding window of `n` elements.
|
|
8092
8327
|
*
|
|
@@ -8358,6 +8593,7 @@ export const splitLines: <E, R>(self: Stream<string, E, R>) => Stream<string, E,
|
|
|
8358
8593
|
* Creates a single-valued pure stream.
|
|
8359
8594
|
*
|
|
8360
8595
|
* @example
|
|
8596
|
+
* ```ts
|
|
8361
8597
|
* import { Effect, Stream } from "effect"
|
|
8362
8598
|
*
|
|
8363
8599
|
* // A Stream with a single number
|
|
@@ -8365,6 +8601,7 @@ export const splitLines: <E, R>(self: Stream<string, E, R>) => Stream<string, E,
|
|
|
8365
8601
|
*
|
|
8366
8602
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8367
8603
|
* // { _id: 'Chunk', values: [ 3 ] }
|
|
8604
|
+
* ```
|
|
8368
8605
|
*
|
|
8369
8606
|
* @since 2.0.0
|
|
8370
8607
|
* @category constructors
|
|
@@ -8391,12 +8628,14 @@ export const suspend: <A, E, R>(stream: LazyArg<Stream<A, E, R>>) => Stream<A, E
|
|
|
8391
8628
|
* Takes the specified number of elements from this stream.
|
|
8392
8629
|
*
|
|
8393
8630
|
* @example
|
|
8631
|
+
* ```ts
|
|
8394
8632
|
* import { Effect, Stream } from "effect"
|
|
8395
8633
|
*
|
|
8396
8634
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
8397
8635
|
*
|
|
8398
8636
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8399
8637
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8638
|
+
* ```
|
|
8400
8639
|
*
|
|
8401
8640
|
* @since 2.0.0
|
|
8402
8641
|
* @category utils
|
|
@@ -8406,12 +8645,14 @@ export const take: {
|
|
|
8406
8645
|
* Takes the specified number of elements from this stream.
|
|
8407
8646
|
*
|
|
8408
8647
|
* @example
|
|
8648
|
+
* ```ts
|
|
8409
8649
|
* import { Effect, Stream } from "effect"
|
|
8410
8650
|
*
|
|
8411
8651
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
8412
8652
|
*
|
|
8413
8653
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8414
8654
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8655
|
+
* ```
|
|
8415
8656
|
*
|
|
8416
8657
|
* @since 2.0.0
|
|
8417
8658
|
* @category utils
|
|
@@ -8421,12 +8662,14 @@ export const take: {
|
|
|
8421
8662
|
* Takes the specified number of elements from this stream.
|
|
8422
8663
|
*
|
|
8423
8664
|
* @example
|
|
8665
|
+
* ```ts
|
|
8424
8666
|
* import { Effect, Stream } from "effect"
|
|
8425
8667
|
*
|
|
8426
8668
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
8427
8669
|
*
|
|
8428
8670
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8429
8671
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8672
|
+
* ```
|
|
8430
8673
|
*
|
|
8431
8674
|
* @since 2.0.0
|
|
8432
8675
|
* @category utils
|
|
@@ -8438,12 +8681,14 @@ export const take: {
|
|
|
8438
8681
|
* Takes the last specified number of elements from this stream.
|
|
8439
8682
|
*
|
|
8440
8683
|
* @example
|
|
8684
|
+
* ```ts
|
|
8441
8685
|
* import { Effect, Stream } from "effect"
|
|
8442
8686
|
*
|
|
8443
8687
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
8444
8688
|
*
|
|
8445
8689
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8446
8690
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
8691
|
+
* ```
|
|
8447
8692
|
*
|
|
8448
8693
|
* @since 2.0.0
|
|
8449
8694
|
* @category utils
|
|
@@ -8453,12 +8698,14 @@ export const takeRight: {
|
|
|
8453
8698
|
* Takes the last specified number of elements from this stream.
|
|
8454
8699
|
*
|
|
8455
8700
|
* @example
|
|
8701
|
+
* ```ts
|
|
8456
8702
|
* import { Effect, Stream } from "effect"
|
|
8457
8703
|
*
|
|
8458
8704
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
8459
8705
|
*
|
|
8460
8706
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8461
8707
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
8708
|
+
* ```
|
|
8462
8709
|
*
|
|
8463
8710
|
* @since 2.0.0
|
|
8464
8711
|
* @category utils
|
|
@@ -8468,12 +8715,14 @@ export const takeRight: {
|
|
|
8468
8715
|
* Takes the last specified number of elements from this stream.
|
|
8469
8716
|
*
|
|
8470
8717
|
* @example
|
|
8718
|
+
* ```ts
|
|
8471
8719
|
* import { Effect, Stream } from "effect"
|
|
8472
8720
|
*
|
|
8473
8721
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
8474
8722
|
*
|
|
8475
8723
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8476
8724
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
8725
|
+
* ```
|
|
8477
8726
|
*
|
|
8478
8727
|
* @since 2.0.0
|
|
8479
8728
|
* @category utils
|
|
@@ -8486,12 +8735,14 @@ export const takeRight: {
|
|
|
8486
8735
|
* `true`.
|
|
8487
8736
|
*
|
|
8488
8737
|
* @example
|
|
8738
|
+
* ```ts
|
|
8489
8739
|
* import { Effect, Stream } from "effect"
|
|
8490
8740
|
*
|
|
8491
8741
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
8492
8742
|
*
|
|
8493
8743
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8494
8744
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8745
|
+
* ```
|
|
8495
8746
|
*
|
|
8496
8747
|
* @since 2.0.0
|
|
8497
8748
|
* @category utils
|
|
@@ -8502,12 +8753,14 @@ export const takeUntil: {
|
|
|
8502
8753
|
* `true`.
|
|
8503
8754
|
*
|
|
8504
8755
|
* @example
|
|
8756
|
+
* ```ts
|
|
8505
8757
|
* import { Effect, Stream } from "effect"
|
|
8506
8758
|
*
|
|
8507
8759
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
8508
8760
|
*
|
|
8509
8761
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8510
8762
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8763
|
+
* ```
|
|
8511
8764
|
*
|
|
8512
8765
|
* @since 2.0.0
|
|
8513
8766
|
* @category utils
|
|
@@ -8518,12 +8771,14 @@ export const takeUntil: {
|
|
|
8518
8771
|
* `true`.
|
|
8519
8772
|
*
|
|
8520
8773
|
* @example
|
|
8774
|
+
* ```ts
|
|
8521
8775
|
* import { Effect, Stream } from "effect"
|
|
8522
8776
|
*
|
|
8523
8777
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
8524
8778
|
*
|
|
8525
8779
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8526
8780
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8781
|
+
* ```
|
|
8527
8782
|
*
|
|
8528
8783
|
* @since 2.0.0
|
|
8529
8784
|
* @category utils
|
|
@@ -8567,12 +8822,14 @@ export const takeUntilEffect: {
|
|
|
8567
8822
|
* evaluates to `true`.
|
|
8568
8823
|
*
|
|
8569
8824
|
* @example
|
|
8825
|
+
* ```ts
|
|
8570
8826
|
* import { Effect, Stream } from "effect"
|
|
8571
8827
|
*
|
|
8572
8828
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8573
8829
|
*
|
|
8574
8830
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8575
8831
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8832
|
+
* ```
|
|
8576
8833
|
*
|
|
8577
8834
|
* @since 2.0.0
|
|
8578
8835
|
* @category utils
|
|
@@ -8583,12 +8840,14 @@ export const takeWhile: {
|
|
|
8583
8840
|
* evaluates to `true`.
|
|
8584
8841
|
*
|
|
8585
8842
|
* @example
|
|
8843
|
+
* ```ts
|
|
8586
8844
|
* import { Effect, Stream } from "effect"
|
|
8587
8845
|
*
|
|
8588
8846
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8589
8847
|
*
|
|
8590
8848
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8591
8849
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8850
|
+
* ```
|
|
8592
8851
|
*
|
|
8593
8852
|
* @since 2.0.0
|
|
8594
8853
|
* @category utils
|
|
@@ -8599,12 +8858,14 @@ export const takeWhile: {
|
|
|
8599
8858
|
* evaluates to `true`.
|
|
8600
8859
|
*
|
|
8601
8860
|
* @example
|
|
8861
|
+
* ```ts
|
|
8602
8862
|
* import { Effect, Stream } from "effect"
|
|
8603
8863
|
*
|
|
8604
8864
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8605
8865
|
*
|
|
8606
8866
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8607
8867
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8868
|
+
* ```
|
|
8608
8869
|
*
|
|
8609
8870
|
* @since 2.0.0
|
|
8610
8871
|
* @category utils
|
|
@@ -8615,12 +8876,14 @@ export const takeWhile: {
|
|
|
8615
8876
|
* evaluates to `true`.
|
|
8616
8877
|
*
|
|
8617
8878
|
* @example
|
|
8879
|
+
* ```ts
|
|
8618
8880
|
* import { Effect, Stream } from "effect"
|
|
8619
8881
|
*
|
|
8620
8882
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8621
8883
|
*
|
|
8622
8884
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8623
8885
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8886
|
+
* ```
|
|
8624
8887
|
*
|
|
8625
8888
|
* @since 2.0.0
|
|
8626
8889
|
* @category utils
|
|
@@ -8631,12 +8894,14 @@ export const takeWhile: {
|
|
|
8631
8894
|
* evaluates to `true`.
|
|
8632
8895
|
*
|
|
8633
8896
|
* @example
|
|
8897
|
+
* ```ts
|
|
8634
8898
|
* import { Effect, Stream } from "effect"
|
|
8635
8899
|
*
|
|
8636
8900
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
8637
8901
|
*
|
|
8638
8902
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8639
8903
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8904
|
+
* ```
|
|
8640
8905
|
*
|
|
8641
8906
|
* @since 2.0.0
|
|
8642
8907
|
* @category utils
|
|
@@ -8648,6 +8913,7 @@ export const takeWhile: {
|
|
|
8648
8913
|
* Adds an effect to consumption of every element of the stream.
|
|
8649
8914
|
*
|
|
8650
8915
|
* @example
|
|
8916
|
+
* ```ts
|
|
8651
8917
|
* import { Console, Effect, Stream } from "effect"
|
|
8652
8918
|
*
|
|
8653
8919
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -8664,6 +8930,7 @@ export const takeWhile: {
|
|
|
8664
8930
|
* // before mapping: 3
|
|
8665
8931
|
* // after mapping: 6
|
|
8666
8932
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
8933
|
+
* ```
|
|
8667
8934
|
*
|
|
8668
8935
|
* @since 2.0.0
|
|
8669
8936
|
* @category sequencing
|
|
@@ -8673,6 +8940,7 @@ export const tap: {
|
|
|
8673
8940
|
* Adds an effect to consumption of every element of the stream.
|
|
8674
8941
|
*
|
|
8675
8942
|
* @example
|
|
8943
|
+
* ```ts
|
|
8676
8944
|
* import { Console, Effect, Stream } from "effect"
|
|
8677
8945
|
*
|
|
8678
8946
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -8689,6 +8957,7 @@ export const tap: {
|
|
|
8689
8957
|
* // before mapping: 3
|
|
8690
8958
|
* // after mapping: 6
|
|
8691
8959
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
8960
|
+
* ```
|
|
8692
8961
|
*
|
|
8693
8962
|
* @since 2.0.0
|
|
8694
8963
|
* @category sequencing
|
|
@@ -8700,6 +8969,7 @@ export const tap: {
|
|
|
8700
8969
|
* Adds an effect to consumption of every element of the stream.
|
|
8701
8970
|
*
|
|
8702
8971
|
* @example
|
|
8972
|
+
* ```ts
|
|
8703
8973
|
* import { Console, Effect, Stream } from "effect"
|
|
8704
8974
|
*
|
|
8705
8975
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -8716,6 +8986,7 @@ export const tap: {
|
|
|
8716
8986
|
* // before mapping: 3
|
|
8717
8987
|
* // after mapping: 6
|
|
8718
8988
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
8989
|
+
* ```
|
|
8719
8990
|
*
|
|
8720
8991
|
* @since 2.0.0
|
|
8721
8992
|
* @category sequencing
|
|
@@ -8856,6 +9127,7 @@ export const tapSink: {
|
|
|
8856
9127
|
* Defaults to the "shape" strategy.
|
|
8857
9128
|
*
|
|
8858
9129
|
* @example
|
|
9130
|
+
* ```ts
|
|
8859
9131
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
8860
9132
|
*
|
|
8861
9133
|
* let last = Date.now()
|
|
@@ -8891,6 +9163,7 @@ export const tapSink: {
|
|
|
8891
9163
|
* // Received 5 after 52ms
|
|
8892
9164
|
* // > Emitted 5 after 49ms
|
|
8893
9165
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
|
|
9166
|
+
* ```
|
|
8894
9167
|
*
|
|
8895
9168
|
* @since 2.0.0
|
|
8896
9169
|
* @category utils
|
|
@@ -8910,6 +9183,7 @@ export const throttle: {
|
|
|
8910
9183
|
* Defaults to the "shape" strategy.
|
|
8911
9184
|
*
|
|
8912
9185
|
* @example
|
|
9186
|
+
* ```ts
|
|
8913
9187
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
8914
9188
|
*
|
|
8915
9189
|
* let last = Date.now()
|
|
@@ -8945,6 +9219,7 @@ export const throttle: {
|
|
|
8945
9219
|
* // Received 5 after 52ms
|
|
8946
9220
|
* // > Emitted 5 after 49ms
|
|
8947
9221
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
|
|
9222
|
+
* ```
|
|
8948
9223
|
*
|
|
8949
9224
|
* @since 2.0.0
|
|
8950
9225
|
* @category utils
|
|
@@ -8972,6 +9247,7 @@ export const throttle: {
|
|
|
8972
9247
|
* Defaults to the "shape" strategy.
|
|
8973
9248
|
*
|
|
8974
9249
|
* @example
|
|
9250
|
+
* ```ts
|
|
8975
9251
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
8976
9252
|
*
|
|
8977
9253
|
* let last = Date.now()
|
|
@@ -9007,6 +9283,7 @@ export const throttle: {
|
|
|
9007
9283
|
* // Received 5 after 52ms
|
|
9008
9284
|
* // > Emitted 5 after 49ms
|
|
9009
9285
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
|
|
9286
|
+
* ```
|
|
9010
9287
|
*
|
|
9011
9288
|
* @since 2.0.0
|
|
9012
9289
|
* @category utils
|
|
@@ -9097,6 +9374,7 @@ export const throttleEffect: {
|
|
|
9097
9374
|
* A stream that emits void values spaced by the specified duration.
|
|
9098
9375
|
*
|
|
9099
9376
|
* @example
|
|
9377
|
+
* ```ts
|
|
9100
9378
|
* import { Effect, Stream } from "effect"
|
|
9101
9379
|
*
|
|
9102
9380
|
* let last = Date.now()
|
|
@@ -9116,6 +9394,7 @@ export const throttleEffect: {
|
|
|
9116
9394
|
* // tick after 1002ms
|
|
9117
9395
|
* // tick after 1002ms
|
|
9118
9396
|
* // { _id: 'Chunk', values: [ undefined, undefined, undefined, undefined, undefined ] }
|
|
9397
|
+
* ```
|
|
9119
9398
|
*
|
|
9120
9399
|
* @since 2.0.0
|
|
9121
9400
|
* @category constructors
|
|
@@ -9287,6 +9566,7 @@ export const toPubSub: {
|
|
|
9287
9566
|
* the stream's output.
|
|
9288
9567
|
*
|
|
9289
9568
|
* @example
|
|
9569
|
+
* ```ts
|
|
9290
9570
|
* import { Effect, Stream } from "effect"
|
|
9291
9571
|
*
|
|
9292
9572
|
* // Simulate a chunked stream
|
|
@@ -9311,6 +9591,7 @@ export const toPubSub: {
|
|
|
9311
9591
|
* // "_id": "Option",
|
|
9312
9592
|
* // "_tag": "None"
|
|
9313
9593
|
* // }
|
|
9594
|
+
* ```
|
|
9314
9595
|
*
|
|
9315
9596
|
* @since 2.0.0
|
|
9316
9597
|
* @category destructors
|
|
@@ -9530,12 +9811,14 @@ export const transduce: {
|
|
|
9530
9811
|
* Creates a stream by peeling off the "layers" of a value of type `S`.
|
|
9531
9812
|
*
|
|
9532
9813
|
* @example
|
|
9814
|
+
* ```ts
|
|
9533
9815
|
* import { Effect, Option, Stream } from "effect"
|
|
9534
9816
|
*
|
|
9535
9817
|
* const stream = Stream.unfold(1, (n) => Option.some([n, n + 1]))
|
|
9536
9818
|
*
|
|
9537
9819
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
9538
9820
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
9821
|
+
* ```
|
|
9539
9822
|
*
|
|
9540
9823
|
* @since 2.0.0
|
|
9541
9824
|
* @category constructors
|
|
@@ -9570,6 +9853,7 @@ export const unfoldChunkEffect: <S, A, E, R>(
|
|
|
9570
9853
|
* `S`.
|
|
9571
9854
|
*
|
|
9572
9855
|
* @example
|
|
9856
|
+
* ```ts
|
|
9573
9857
|
* import { Effect, Option, Random, Stream } from "effect"
|
|
9574
9858
|
*
|
|
9575
9859
|
* const stream = Stream.unfoldEffect(1, (n) =>
|
|
@@ -9579,6 +9863,7 @@ export const unfoldChunkEffect: <S, A, E, R>(
|
|
|
9579
9863
|
*
|
|
9580
9864
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
9581
9865
|
* // { _id: 'Chunk', values: [ 1, -1, -1, -1, -1 ] }
|
|
9866
|
+
* ```
|
|
9582
9867
|
*
|
|
9583
9868
|
* @since 2.0.0
|
|
9584
9869
|
* @category constructors
|
|
@@ -9594,6 +9879,7 @@ export {
|
|
|
9594
9879
|
* A stream that contains a single `void` value.
|
|
9595
9880
|
*
|
|
9596
9881
|
* @example
|
|
9882
|
+
* ```ts
|
|
9597
9883
|
* import { Effect, Stream } from "effect"
|
|
9598
9884
|
*
|
|
9599
9885
|
* const stream = Stream.void
|
|
@@ -9601,6 +9887,7 @@ export {
|
|
|
9601
9887
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9602
9888
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
9603
9889
|
*
|
|
9890
|
+
* ```
|
|
9604
9891
|
* @since 2.0.0
|
|
9605
9892
|
* @category constructors
|
|
9606
9893
|
*/
|
|
@@ -9626,6 +9913,18 @@ export const unwrapScoped: <A, E2, R2, E, R>(
|
|
|
9626
9913
|
effect: Effect.Effect<Stream<A, E2, R2>, E, R>
|
|
9627
9914
|
) => Stream<A, E | E2, R2 | Exclude<R, Scope.Scope>> = internal.unwrapScoped
|
|
9628
9915
|
|
|
9916
|
+
/**
|
|
9917
|
+
* Creates a stream produced from a function which receives a `Scope` and
|
|
9918
|
+
* returns an `Effect`. The resulting stream will emit a single element, which
|
|
9919
|
+
* will be the result of the returned effect, if successful.
|
|
9920
|
+
*
|
|
9921
|
+
* @since 3.11.0
|
|
9922
|
+
* @category constructors
|
|
9923
|
+
*/
|
|
9924
|
+
export const unwrapScopedWith: <A, E2, R2, E, R>(
|
|
9925
|
+
f: (scope: Scope.Scope) => Effect.Effect<Stream<A, E2, R2>, E, R>
|
|
9926
|
+
) => Stream<A, E | E2, R | R2> = internal.unwrapScopedWith
|
|
9927
|
+
|
|
9629
9928
|
/**
|
|
9630
9929
|
* Updates the specified service within the context of the `Stream`.
|
|
9631
9930
|
*
|
|
@@ -9788,6 +10087,7 @@ export const withSpan: {
|
|
|
9788
10087
|
* The new stream will end when one of the sides ends.
|
|
9789
10088
|
*
|
|
9790
10089
|
* @example
|
|
10090
|
+
* ```ts
|
|
9791
10091
|
* import { Effect, Stream } from "effect"
|
|
9792
10092
|
*
|
|
9793
10093
|
* // We create two streams and zip them together.
|
|
@@ -9798,6 +10098,7 @@ export const withSpan: {
|
|
|
9798
10098
|
*
|
|
9799
10099
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9800
10100
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
10101
|
+
* ```
|
|
9801
10102
|
*
|
|
9802
10103
|
* @since 2.0.0
|
|
9803
10104
|
* @category zipping
|
|
@@ -9810,6 +10111,7 @@ export const zip: {
|
|
|
9810
10111
|
* The new stream will end when one of the sides ends.
|
|
9811
10112
|
*
|
|
9812
10113
|
* @example
|
|
10114
|
+
* ```ts
|
|
9813
10115
|
* import { Effect, Stream } from "effect"
|
|
9814
10116
|
*
|
|
9815
10117
|
* // We create two streams and zip them together.
|
|
@@ -9820,6 +10122,7 @@ export const zip: {
|
|
|
9820
10122
|
*
|
|
9821
10123
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9822
10124
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
10125
|
+
* ```
|
|
9823
10126
|
*
|
|
9824
10127
|
* @since 2.0.0
|
|
9825
10128
|
* @category zipping
|
|
@@ -9832,6 +10135,7 @@ export const zip: {
|
|
|
9832
10135
|
* The new stream will end when one of the sides ends.
|
|
9833
10136
|
*
|
|
9834
10137
|
* @example
|
|
10138
|
+
* ```ts
|
|
9835
10139
|
* import { Effect, Stream } from "effect"
|
|
9836
10140
|
*
|
|
9837
10141
|
* // We create two streams and zip them together.
|
|
@@ -9842,6 +10146,7 @@ export const zip: {
|
|
|
9842
10146
|
*
|
|
9843
10147
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9844
10148
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
10149
|
+
* ```
|
|
9845
10150
|
*
|
|
9846
10151
|
* @since 2.0.0
|
|
9847
10152
|
* @category zipping
|
|
@@ -9894,6 +10199,7 @@ export const zipFlatten: {
|
|
|
9894
10199
|
* have different lengths and one of the streams has ended before the other.
|
|
9895
10200
|
*
|
|
9896
10201
|
* @example
|
|
10202
|
+
* ```ts
|
|
9897
10203
|
* import { Effect, Stream } from "effect"
|
|
9898
10204
|
*
|
|
9899
10205
|
* const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9904,6 +10210,7 @@ export const zipFlatten: {
|
|
|
9904
10210
|
*
|
|
9905
10211
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9906
10212
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
10213
|
+
* ```
|
|
9907
10214
|
*
|
|
9908
10215
|
* @since 2.0.0
|
|
9909
10216
|
* @category zipping
|
|
@@ -9917,6 +10224,7 @@ export const zipAll: {
|
|
|
9917
10224
|
* have different lengths and one of the streams has ended before the other.
|
|
9918
10225
|
*
|
|
9919
10226
|
* @example
|
|
10227
|
+
* ```ts
|
|
9920
10228
|
* import { Effect, Stream } from "effect"
|
|
9921
10229
|
*
|
|
9922
10230
|
* const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9927,6 +10235,7 @@ export const zipAll: {
|
|
|
9927
10235
|
*
|
|
9928
10236
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9929
10237
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
10238
|
+
* ```
|
|
9930
10239
|
*
|
|
9931
10240
|
* @since 2.0.0
|
|
9932
10241
|
* @category zipping
|
|
@@ -9942,6 +10251,7 @@ export const zipAll: {
|
|
|
9942
10251
|
* have different lengths and one of the streams has ended before the other.
|
|
9943
10252
|
*
|
|
9944
10253
|
* @example
|
|
10254
|
+
* ```ts
|
|
9945
10255
|
* import { Effect, Stream } from "effect"
|
|
9946
10256
|
*
|
|
9947
10257
|
* const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9952,6 +10262,7 @@ export const zipAll: {
|
|
|
9952
10262
|
*
|
|
9953
10263
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9954
10264
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
10265
|
+
* ```
|
|
9955
10266
|
*
|
|
9956
10267
|
* @since 2.0.0
|
|
9957
10268
|
* @category zipping
|
|
@@ -10283,6 +10594,7 @@ export const zipAllSortedByKeyWith: {
|
|
|
10283
10594
|
* lengths and one of the streams has ended before the other.
|
|
10284
10595
|
*
|
|
10285
10596
|
* @example
|
|
10597
|
+
* ```ts
|
|
10286
10598
|
* import { Effect, Stream } from "effect"
|
|
10287
10599
|
*
|
|
10288
10600
|
* const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -10294,6 +10606,7 @@ export const zipAllSortedByKeyWith: {
|
|
|
10294
10606
|
*
|
|
10295
10607
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10296
10608
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
10609
|
+
* ```
|
|
10297
10610
|
*
|
|
10298
10611
|
* @since 2.0.0
|
|
10299
10612
|
* @category zipping
|
|
@@ -10307,6 +10620,7 @@ export const zipAllWith: {
|
|
|
10307
10620
|
* lengths and one of the streams has ended before the other.
|
|
10308
10621
|
*
|
|
10309
10622
|
* @example
|
|
10623
|
+
* ```ts
|
|
10310
10624
|
* import { Effect, Stream } from "effect"
|
|
10311
10625
|
*
|
|
10312
10626
|
* const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -10318,6 +10632,7 @@ export const zipAllWith: {
|
|
|
10318
10632
|
*
|
|
10319
10633
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10320
10634
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
10635
|
+
* ```
|
|
10321
10636
|
*
|
|
10322
10637
|
* @since 2.0.0
|
|
10323
10638
|
* @category zipping
|
|
@@ -10338,6 +10653,7 @@ export const zipAllWith: {
|
|
|
10338
10653
|
* lengths and one of the streams has ended before the other.
|
|
10339
10654
|
*
|
|
10340
10655
|
* @example
|
|
10656
|
+
* ```ts
|
|
10341
10657
|
* import { Effect, Stream } from "effect"
|
|
10342
10658
|
*
|
|
10343
10659
|
* const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -10349,6 +10665,7 @@ export const zipAllWith: {
|
|
|
10349
10665
|
*
|
|
10350
10666
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10351
10667
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
10668
|
+
* ```
|
|
10352
10669
|
*
|
|
10353
10670
|
* @since 2.0.0
|
|
10354
10671
|
* @category zipping
|
|
@@ -10374,6 +10691,7 @@ export const zipAllWith: {
|
|
|
10374
10691
|
* used for zipping.
|
|
10375
10692
|
*
|
|
10376
10693
|
* @example
|
|
10694
|
+
* ```ts
|
|
10377
10695
|
* import { Effect, Schedule, Stream } from "effect"
|
|
10378
10696
|
*
|
|
10379
10697
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -10388,6 +10706,7 @@ export const zipAllWith: {
|
|
|
10388
10706
|
*
|
|
10389
10707
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10390
10708
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
10709
|
+
* ```
|
|
10391
10710
|
*
|
|
10392
10711
|
* @since 2.0.0
|
|
10393
10712
|
* @category zipping
|
|
@@ -10403,6 +10722,7 @@ export const zipLatest: {
|
|
|
10403
10722
|
* used for zipping.
|
|
10404
10723
|
*
|
|
10405
10724
|
* @example
|
|
10725
|
+
* ```ts
|
|
10406
10726
|
* import { Effect, Schedule, Stream } from "effect"
|
|
10407
10727
|
*
|
|
10408
10728
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -10417,6 +10737,7 @@ export const zipLatest: {
|
|
|
10417
10737
|
*
|
|
10418
10738
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10419
10739
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
10740
|
+
* ```
|
|
10420
10741
|
*
|
|
10421
10742
|
* @since 2.0.0
|
|
10422
10743
|
* @category zipping
|
|
@@ -10432,6 +10753,7 @@ export const zipLatest: {
|
|
|
10432
10753
|
* used for zipping.
|
|
10433
10754
|
*
|
|
10434
10755
|
* @example
|
|
10756
|
+
* ```ts
|
|
10435
10757
|
* import { Effect, Schedule, Stream } from "effect"
|
|
10436
10758
|
*
|
|
10437
10759
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -10446,6 +10768,7 @@ export const zipLatest: {
|
|
|
10446
10768
|
*
|
|
10447
10769
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10448
10770
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
10771
|
+
* ```
|
|
10449
10772
|
*
|
|
10450
10773
|
* @since 2.0.0
|
|
10451
10774
|
* @category zipping
|
|
@@ -10462,6 +10785,7 @@ export const zipLatest: {
|
|
|
10462
10785
|
* used for zipping.
|
|
10463
10786
|
*
|
|
10464
10787
|
* @example
|
|
10788
|
+
* ```ts
|
|
10465
10789
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
10466
10790
|
*
|
|
10467
10791
|
* const stream = Stream.zipLatestAll(
|
|
@@ -10479,6 +10803,7 @@ export const zipLatest: {
|
|
|
10479
10803
|
* // [ 3, 1, 0 ]
|
|
10480
10804
|
* // [ 3, 1, 1 ]
|
|
10481
10805
|
* // .....
|
|
10806
|
+
* ```
|
|
10482
10807
|
*
|
|
10483
10808
|
* @since 3.3.0
|
|
10484
10809
|
* @category zipping
|
|
@@ -10611,6 +10936,7 @@ export const zipRight: {
|
|
|
10611
10936
|
* The new stream will end when one of the sides ends.
|
|
10612
10937
|
*
|
|
10613
10938
|
* @example
|
|
10939
|
+
* ```ts
|
|
10614
10940
|
* import { Effect, Stream } from "effect"
|
|
10615
10941
|
*
|
|
10616
10942
|
* // We create two streams and zip them with custom logic.
|
|
@@ -10622,6 +10948,7 @@ export const zipRight: {
|
|
|
10622
10948
|
*
|
|
10623
10949
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10624
10950
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10951
|
+
* ```
|
|
10625
10952
|
*
|
|
10626
10953
|
* @since 2.0.0
|
|
10627
10954
|
* @category zipping
|
|
@@ -10634,6 +10961,7 @@ export const zipWith: {
|
|
|
10634
10961
|
* The new stream will end when one of the sides ends.
|
|
10635
10962
|
*
|
|
10636
10963
|
* @example
|
|
10964
|
+
* ```ts
|
|
10637
10965
|
* import { Effect, Stream } from "effect"
|
|
10638
10966
|
*
|
|
10639
10967
|
* // We create two streams and zip them with custom logic.
|
|
@@ -10645,6 +10973,7 @@ export const zipWith: {
|
|
|
10645
10973
|
*
|
|
10646
10974
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10647
10975
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10976
|
+
* ```
|
|
10648
10977
|
*
|
|
10649
10978
|
* @since 2.0.0
|
|
10650
10979
|
* @category zipping
|
|
@@ -10660,6 +10989,7 @@ export const zipWith: {
|
|
|
10660
10989
|
* The new stream will end when one of the sides ends.
|
|
10661
10990
|
*
|
|
10662
10991
|
* @example
|
|
10992
|
+
* ```ts
|
|
10663
10993
|
* import { Effect, Stream } from "effect"
|
|
10664
10994
|
*
|
|
10665
10995
|
* // We create two streams and zip them with custom logic.
|
|
@@ -10671,6 +11001,7 @@ export const zipWith: {
|
|
|
10671
11001
|
*
|
|
10672
11002
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
10673
11003
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
11004
|
+
* ```
|
|
10674
11005
|
*
|
|
10675
11006
|
* @since 2.0.0
|
|
10676
11007
|
* @category zipping
|
|
@@ -10731,6 +11062,7 @@ export const zipWithChunks: {
|
|
|
10731
11062
|
* Zips each element with the next element if present.
|
|
10732
11063
|
*
|
|
10733
11064
|
* @example
|
|
11065
|
+
* ```ts
|
|
10734
11066
|
* import { Chunk, Effect, Stream } from "effect"
|
|
10735
11067
|
*
|
|
10736
11068
|
* const stream = Stream.zipWithNext(Stream.make(1, 2, 3, 4))
|
|
@@ -10742,6 +11074,7 @@ export const zipWithChunks: {
|
|
|
10742
11074
|
* // [ 3, { _id: 'Option', _tag: 'Some', value: 4 } ],
|
|
10743
11075
|
* // [ 4, { _id: 'Option', _tag: 'None' } ]
|
|
10744
11076
|
* // ]
|
|
11077
|
+
* ```
|
|
10745
11078
|
*
|
|
10746
11079
|
* @since 2.0.0
|
|
10747
11080
|
* @category zipping
|
|
@@ -10753,6 +11086,7 @@ export const zipWithNext: <A, E, R>(self: Stream<A, E, R>) => Stream<[A, Option.
|
|
|
10753
11086
|
* `None`.
|
|
10754
11087
|
*
|
|
10755
11088
|
* @example
|
|
11089
|
+
* ```ts
|
|
10756
11090
|
* import { Chunk, Effect, Stream } from "effect"
|
|
10757
11091
|
*
|
|
10758
11092
|
* const stream = Stream.zipWithPrevious(Stream.make(1, 2, 3, 4))
|
|
@@ -10764,6 +11098,7 @@ export const zipWithNext: <A, E, R>(self: Stream<A, E, R>) => Stream<[A, Option.
|
|
|
10764
11098
|
* // [ { _id: 'Option', _tag: 'Some', value: 2 }, 3 ],
|
|
10765
11099
|
* // [ { _id: 'Option', _tag: 'Some', value: 3 }, 4 ]
|
|
10766
11100
|
* // ]
|
|
11101
|
+
* ```
|
|
10767
11102
|
*
|
|
10768
11103
|
* @since 2.0.0
|
|
10769
11104
|
* @category zipping
|
|
@@ -10775,6 +11110,7 @@ export const zipWithPrevious: <A, E, R>(self: Stream<A, E, R>) => Stream<[Option
|
|
|
10775
11110
|
* Zips each element with both the previous and next element.
|
|
10776
11111
|
*
|
|
10777
11112
|
* @example
|
|
11113
|
+
* ```ts
|
|
10778
11114
|
* import { Chunk, Effect, Stream } from "effect"
|
|
10779
11115
|
*
|
|
10780
11116
|
* const stream = Stream.zipWithPreviousAndNext(Stream.make(1, 2, 3, 4))
|
|
@@ -10802,6 +11138,7 @@ export const zipWithPrevious: <A, E, R>(self: Stream<A, E, R>) => Stream<[Option
|
|
|
10802
11138
|
* // { _id: 'Option', _tag: 'None' }
|
|
10803
11139
|
* // ]
|
|
10804
11140
|
* // ]
|
|
11141
|
+
* ```
|
|
10805
11142
|
*
|
|
10806
11143
|
* @since 2.0.0
|
|
10807
11144
|
* @category zipping
|
|
@@ -10814,6 +11151,7 @@ export const zipWithPreviousAndNext: <A, E, R>(
|
|
|
10814
11151
|
* Zips this stream together with the index of elements.
|
|
10815
11152
|
*
|
|
10816
11153
|
* @example
|
|
11154
|
+
* ```ts
|
|
10817
11155
|
* import { Effect, Stream } from "effect"
|
|
10818
11156
|
*
|
|
10819
11157
|
* const stream = Stream.make("Mary", "James", "Robert", "Patricia")
|
|
@@ -10825,6 +11163,7 @@ export const zipWithPreviousAndNext: <A, E, R>(
|
|
|
10825
11163
|
* // _id: 'Chunk',
|
|
10826
11164
|
* // values: [ [ 'Mary', 0 ], [ 'James', 1 ], [ 'Robert', 2 ], [ 'Patricia', 3 ] ]
|
|
10827
11165
|
* // }
|
|
11166
|
+
* ```
|
|
10828
11167
|
*
|
|
10829
11168
|
* @since 2.0.0
|
|
10830
11169
|
* @category zipping
|
|
@@ -10851,6 +11190,7 @@ export const zipWithIndex: <A, E, R>(self: Stream<A, E, R>) => Stream<[A, number
|
|
|
10851
11190
|
* @see {@link let_ let}
|
|
10852
11191
|
*
|
|
10853
11192
|
* @example
|
|
11193
|
+
* ```ts
|
|
10854
11194
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10855
11195
|
*
|
|
10856
11196
|
* const result = pipe(
|
|
@@ -10860,6 +11200,7 @@ export const zipWithIndex: <A, E, R>(self: Stream<A, E, R>) => Stream<[A, number
|
|
|
10860
11200
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10861
11201
|
* )
|
|
10862
11202
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11203
|
+
* ```
|
|
10863
11204
|
*
|
|
10864
11205
|
* @category do notation
|
|
10865
11206
|
* @since 2.0.0
|
|
@@ -10882,6 +11223,7 @@ export const Do: Stream<{}> = internal.Do
|
|
|
10882
11223
|
* @see {@link let_ let}
|
|
10883
11224
|
*
|
|
10884
11225
|
* @example
|
|
11226
|
+
* ```ts
|
|
10885
11227
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10886
11228
|
*
|
|
10887
11229
|
* const result = pipe(
|
|
@@ -10891,6 +11233,7 @@ export const Do: Stream<{}> = internal.Do
|
|
|
10891
11233
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10892
11234
|
* )
|
|
10893
11235
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11236
|
+
* ```
|
|
10894
11237
|
*
|
|
10895
11238
|
* @category do notation
|
|
10896
11239
|
* @since 2.0.0
|
|
@@ -10912,6 +11255,7 @@ export const bind: {
|
|
|
10912
11255
|
* @see {@link let_ let}
|
|
10913
11256
|
*
|
|
10914
11257
|
* @example
|
|
11258
|
+
* ```ts
|
|
10915
11259
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10916
11260
|
*
|
|
10917
11261
|
* const result = pipe(
|
|
@@ -10921,6 +11265,7 @@ export const bind: {
|
|
|
10921
11265
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10922
11266
|
* )
|
|
10923
11267
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11268
|
+
* ```
|
|
10924
11269
|
*
|
|
10925
11270
|
* @category do notation
|
|
10926
11271
|
* @since 2.0.0
|
|
@@ -10948,6 +11293,7 @@ export const bind: {
|
|
|
10948
11293
|
* @see {@link let_ let}
|
|
10949
11294
|
*
|
|
10950
11295
|
* @example
|
|
11296
|
+
* ```ts
|
|
10951
11297
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10952
11298
|
*
|
|
10953
11299
|
* const result = pipe(
|
|
@@ -10957,6 +11303,7 @@ export const bind: {
|
|
|
10957
11303
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10958
11304
|
* )
|
|
10959
11305
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11306
|
+
* ```
|
|
10960
11307
|
*
|
|
10961
11308
|
* @category do notation
|
|
10962
11309
|
* @since 2.0.0
|
|
@@ -11034,6 +11381,7 @@ export const bindEffect: {
|
|
|
11034
11381
|
* @see {@link let_ let}
|
|
11035
11382
|
*
|
|
11036
11383
|
* @example
|
|
11384
|
+
* ```ts
|
|
11037
11385
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
11038
11386
|
*
|
|
11039
11387
|
* const result = pipe(
|
|
@@ -11043,6 +11391,7 @@ export const bindEffect: {
|
|
|
11043
11391
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
11044
11392
|
* )
|
|
11045
11393
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11394
|
+
* ```
|
|
11046
11395
|
*
|
|
11047
11396
|
* @category do notation
|
|
11048
11397
|
* @since 2.0.0
|
|
@@ -11064,6 +11413,7 @@ export const bindTo: {
|
|
|
11064
11413
|
* @see {@link let_ let}
|
|
11065
11414
|
*
|
|
11066
11415
|
* @example
|
|
11416
|
+
* ```ts
|
|
11067
11417
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
11068
11418
|
*
|
|
11069
11419
|
* const result = pipe(
|
|
@@ -11073,6 +11423,7 @@ export const bindTo: {
|
|
|
11073
11423
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
11074
11424
|
* )
|
|
11075
11425
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11426
|
+
* ```
|
|
11076
11427
|
*
|
|
11077
11428
|
* @category do notation
|
|
11078
11429
|
* @since 2.0.0
|
|
@@ -11094,6 +11445,7 @@ export const bindTo: {
|
|
|
11094
11445
|
* @see {@link let_ let}
|
|
11095
11446
|
*
|
|
11096
11447
|
* @example
|
|
11448
|
+
* ```ts
|
|
11097
11449
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
11098
11450
|
*
|
|
11099
11451
|
* const result = pipe(
|
|
@@ -11103,6 +11455,7 @@ export const bindTo: {
|
|
|
11103
11455
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
11104
11456
|
* )
|
|
11105
11457
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11458
|
+
* ```
|
|
11106
11459
|
*
|
|
11107
11460
|
* @category do notation
|
|
11108
11461
|
* @since 2.0.0
|
|
@@ -11139,6 +11492,7 @@ export {
|
|
|
11139
11492
|
* @see {@link bindEffect}
|
|
11140
11493
|
*
|
|
11141
11494
|
* @example
|
|
11495
|
+
* ```ts
|
|
11142
11496
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
11143
11497
|
*
|
|
11144
11498
|
* const result = pipe(
|
|
@@ -11149,6 +11503,7 @@ export {
|
|
|
11149
11503
|
* )
|
|
11150
11504
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
11151
11505
|
*
|
|
11506
|
+
* ```
|
|
11152
11507
|
* @category do notation
|
|
11153
11508
|
* @since 2.0.0
|
|
11154
11509
|
*/
|