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/dist/dts/Stream.d.ts
CHANGED
|
@@ -174,6 +174,7 @@ export declare const accumulateChunks: <A, E, R>(self: Stream<A, E, R>) => Strea
|
|
|
174
174
|
* stream is consumed.
|
|
175
175
|
*
|
|
176
176
|
* @example
|
|
177
|
+
* ```ts
|
|
177
178
|
* import { Console, Effect, Stream } from "effect"
|
|
178
179
|
*
|
|
179
180
|
* // Simulating File operations
|
|
@@ -195,6 +196,7 @@ export declare const accumulateChunks: <A, E, R>(self: Stream<A, E, R>) => Strea
|
|
|
195
196
|
* // Opening file.txt
|
|
196
197
|
* // Closing file.txt
|
|
197
198
|
* // { _id: 'Chunk', values: [ [ 'Line 1', 'Line 2', 'Line 3' ] ] }
|
|
199
|
+
* ```
|
|
198
200
|
*
|
|
199
201
|
* @since 2.0.0
|
|
200
202
|
* @category constructors
|
|
@@ -339,12 +341,14 @@ export declare const aggregateWithinEither: {
|
|
|
339
341
|
* Maps the success values of this stream to the specified constant value.
|
|
340
342
|
*
|
|
341
343
|
* @example
|
|
344
|
+
* ```ts
|
|
342
345
|
* import { Effect, Stream } from "effect"
|
|
343
346
|
*
|
|
344
347
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
345
348
|
*
|
|
346
349
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
347
350
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
351
|
+
* ```
|
|
348
352
|
*
|
|
349
353
|
* @since 2.0.0
|
|
350
354
|
* @category mapping
|
|
@@ -354,12 +358,14 @@ export declare const as: {
|
|
|
354
358
|
* Maps the success values of this stream to the specified constant value.
|
|
355
359
|
*
|
|
356
360
|
* @example
|
|
361
|
+
* ```ts
|
|
357
362
|
* import { Effect, Stream } from "effect"
|
|
358
363
|
*
|
|
359
364
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
360
365
|
*
|
|
361
366
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
362
367
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
368
|
+
* ```
|
|
363
369
|
*
|
|
364
370
|
* @since 2.0.0
|
|
365
371
|
* @category mapping
|
|
@@ -369,12 +375,14 @@ export declare const as: {
|
|
|
369
375
|
* Maps the success values of this stream to the specified constant value.
|
|
370
376
|
*
|
|
371
377
|
* @example
|
|
378
|
+
* ```ts
|
|
372
379
|
* import { Effect, Stream } from "effect"
|
|
373
380
|
*
|
|
374
381
|
* const stream = Stream.range(1, 5).pipe(Stream.as(null))
|
|
375
382
|
*
|
|
376
383
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
377
384
|
* // { _id: 'Chunk', values: [ null, null, null, null, null ] }
|
|
385
|
+
* ```
|
|
378
386
|
*
|
|
379
387
|
* @since 2.0.0
|
|
380
388
|
* @category mapping
|
|
@@ -395,6 +403,7 @@ export {
|
|
|
395
403
|
* executed if the `Fiber` executing this Effect is interrupted.
|
|
396
404
|
*
|
|
397
405
|
* @example
|
|
406
|
+
* ```ts
|
|
398
407
|
* import type { StreamEmit } from "effect"
|
|
399
408
|
* import { Chunk, Effect, Option, Stream } from "effect"
|
|
400
409
|
*
|
|
@@ -417,6 +426,7 @@ export {
|
|
|
417
426
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
418
427
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
419
428
|
*
|
|
429
|
+
* ```
|
|
420
430
|
* @since 2.0.0
|
|
421
431
|
* @category constructors
|
|
422
432
|
*/
|
|
@@ -448,6 +458,7 @@ export declare const asyncEffect: <A, E = never, R = never>(register: (emit: Emi
|
|
|
448
458
|
* second argument with the `bufferSize` and `strategy` fields.
|
|
449
459
|
*
|
|
450
460
|
* @example
|
|
461
|
+
* ```ts
|
|
451
462
|
* import { Effect, Stream } from "effect"
|
|
452
463
|
*
|
|
453
464
|
* Stream.asyncPush<string>((emit) =>
|
|
@@ -462,6 +473,7 @@ export declare const asyncEffect: <A, E = never, R = never>(register: (emit: Emi
|
|
|
462
473
|
* clearInterval(handle)
|
|
463
474
|
* })
|
|
464
475
|
* ), { bufferSize: 16, strategy: "dropping" })
|
|
476
|
+
* ```
|
|
465
477
|
*
|
|
466
478
|
* @since 3.6.0
|
|
467
479
|
* @category constructors
|
|
@@ -519,6 +531,7 @@ export declare const branchAfter: {
|
|
|
519
531
|
* chunks before the slowest downstream stream.
|
|
520
532
|
*
|
|
521
533
|
* @example
|
|
534
|
+
* ```ts
|
|
522
535
|
* import { Console, Effect, Fiber, Schedule, Stream } from "effect"
|
|
523
536
|
*
|
|
524
537
|
* const numbers = Effect.scoped(
|
|
@@ -588,6 +601,7 @@ export declare const branchAfter: {
|
|
|
588
601
|
* // Logging to the Console: 19
|
|
589
602
|
* // Logging to the Console: 20
|
|
590
603
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
604
|
+
* ```
|
|
591
605
|
*
|
|
592
606
|
* @since 2.0.0
|
|
593
607
|
* @category utils
|
|
@@ -599,6 +613,7 @@ export declare const broadcast: {
|
|
|
599
613
|
* chunks before the slowest downstream stream.
|
|
600
614
|
*
|
|
601
615
|
* @example
|
|
616
|
+
* ```ts
|
|
602
617
|
* import { Console, Effect, Fiber, Schedule, Stream } from "effect"
|
|
603
618
|
*
|
|
604
619
|
* const numbers = Effect.scoped(
|
|
@@ -668,6 +683,7 @@ export declare const broadcast: {
|
|
|
668
683
|
* // Logging to the Console: 19
|
|
669
684
|
* // Logging to the Console: 20
|
|
670
685
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
686
|
+
* ```
|
|
671
687
|
*
|
|
672
688
|
* @since 2.0.0
|
|
673
689
|
* @category utils
|
|
@@ -686,6 +702,7 @@ export declare const broadcast: {
|
|
|
686
702
|
* chunks before the slowest downstream stream.
|
|
687
703
|
*
|
|
688
704
|
* @example
|
|
705
|
+
* ```ts
|
|
689
706
|
* import { Console, Effect, Fiber, Schedule, Stream } from "effect"
|
|
690
707
|
*
|
|
691
708
|
* const numbers = Effect.scoped(
|
|
@@ -755,6 +772,7 @@ export declare const broadcast: {
|
|
|
755
772
|
* // Logging to the Console: 19
|
|
756
773
|
* // Logging to the Console: 20
|
|
757
774
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
775
|
+
* ```
|
|
758
776
|
*
|
|
759
777
|
* @since 2.0.0
|
|
760
778
|
* @category utils
|
|
@@ -961,6 +979,7 @@ export declare const broadcastedQueuesDynamic: {
|
|
|
961
979
|
* of 2 for better performance.
|
|
962
980
|
*
|
|
963
981
|
* @example
|
|
982
|
+
* ```ts
|
|
964
983
|
* import { Console, Effect, Schedule, Stream } from "effect"
|
|
965
984
|
*
|
|
966
985
|
* const stream = Stream.range(1, 10).pipe(
|
|
@@ -987,6 +1006,7 @@ export declare const broadcastedQueuesDynamic: {
|
|
|
987
1006
|
* // after buffering: 5
|
|
988
1007
|
* // before buffering: 10
|
|
989
1008
|
* // ...
|
|
1009
|
+
* ```
|
|
990
1010
|
*
|
|
991
1011
|
* @since 2.0.0
|
|
992
1012
|
* @category utils
|
|
@@ -1001,6 +1021,7 @@ export declare const buffer: {
|
|
|
1001
1021
|
* of 2 for better performance.
|
|
1002
1022
|
*
|
|
1003
1023
|
* @example
|
|
1024
|
+
* ```ts
|
|
1004
1025
|
* import { Console, Effect, Schedule, Stream } from "effect"
|
|
1005
1026
|
*
|
|
1006
1027
|
* const stream = Stream.range(1, 10).pipe(
|
|
@@ -1027,6 +1048,7 @@ export declare const buffer: {
|
|
|
1027
1048
|
* // after buffering: 5
|
|
1028
1049
|
* // before buffering: 10
|
|
1029
1050
|
* // ...
|
|
1051
|
+
* ```
|
|
1030
1052
|
*
|
|
1031
1053
|
* @since 2.0.0
|
|
1032
1054
|
* @category utils
|
|
@@ -1046,6 +1068,7 @@ export declare const buffer: {
|
|
|
1046
1068
|
* of 2 for better performance.
|
|
1047
1069
|
*
|
|
1048
1070
|
* @example
|
|
1071
|
+
* ```ts
|
|
1049
1072
|
* import { Console, Effect, Schedule, Stream } from "effect"
|
|
1050
1073
|
*
|
|
1051
1074
|
* const stream = Stream.range(1, 10).pipe(
|
|
@@ -1072,6 +1095,7 @@ export declare const buffer: {
|
|
|
1072
1095
|
* // after buffering: 5
|
|
1073
1096
|
* // before buffering: 10
|
|
1074
1097
|
* // ...
|
|
1098
|
+
* ```
|
|
1075
1099
|
*
|
|
1076
1100
|
* @since 2.0.0
|
|
1077
1101
|
* @category utils
|
|
@@ -1319,12 +1343,14 @@ export declare const catchSomeCause: {
|
|
|
1319
1343
|
* elements are equal.
|
|
1320
1344
|
*
|
|
1321
1345
|
* @example
|
|
1346
|
+
* ```ts
|
|
1322
1347
|
* import { Effect, Stream } from "effect"
|
|
1323
1348
|
*
|
|
1324
1349
|
* const stream = Stream.make(1, 1, 1, 2, 2, 3, 4).pipe(Stream.changes)
|
|
1325
1350
|
*
|
|
1326
1351
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1327
1352
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
|
|
1353
|
+
* ```
|
|
1328
1354
|
*
|
|
1329
1355
|
* @since 2.0.0
|
|
1330
1356
|
* @category utils
|
|
@@ -1502,6 +1528,7 @@ export declare const combineChunks: {
|
|
|
1502
1528
|
* specified stream.
|
|
1503
1529
|
*
|
|
1504
1530
|
* @example
|
|
1531
|
+
* ```ts
|
|
1505
1532
|
* import { Effect, Stream } from "effect"
|
|
1506
1533
|
*
|
|
1507
1534
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1511,6 +1538,7 @@ export declare const combineChunks: {
|
|
|
1511
1538
|
*
|
|
1512
1539
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1513
1540
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1541
|
+
* ```
|
|
1514
1542
|
*
|
|
1515
1543
|
* @since 2.0.0
|
|
1516
1544
|
* @category utils
|
|
@@ -1522,6 +1550,7 @@ export declare const concat: {
|
|
|
1522
1550
|
* specified stream.
|
|
1523
1551
|
*
|
|
1524
1552
|
* @example
|
|
1553
|
+
* ```ts
|
|
1525
1554
|
* import { Effect, Stream } from "effect"
|
|
1526
1555
|
*
|
|
1527
1556
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1531,6 +1560,7 @@ export declare const concat: {
|
|
|
1531
1560
|
*
|
|
1532
1561
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1533
1562
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1563
|
+
* ```
|
|
1534
1564
|
*
|
|
1535
1565
|
* @since 2.0.0
|
|
1536
1566
|
* @category utils
|
|
@@ -1542,6 +1572,7 @@ export declare const concat: {
|
|
|
1542
1572
|
* specified stream.
|
|
1543
1573
|
*
|
|
1544
1574
|
* @example
|
|
1575
|
+
* ```ts
|
|
1545
1576
|
* import { Effect, Stream } from "effect"
|
|
1546
1577
|
*
|
|
1547
1578
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1551,6 +1582,7 @@ export declare const concat: {
|
|
|
1551
1582
|
*
|
|
1552
1583
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
1553
1584
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
1585
|
+
* ```
|
|
1554
1586
|
*
|
|
1555
1587
|
* @since 2.0.0
|
|
1556
1588
|
* @category utils
|
|
@@ -1561,6 +1593,7 @@ export declare const concat: {
|
|
|
1561
1593
|
* Concatenates all of the streams in the chunk to one stream.
|
|
1562
1594
|
*
|
|
1563
1595
|
* @example
|
|
1596
|
+
* ```ts
|
|
1564
1597
|
* import { Chunk, Effect, Stream } from "effect"
|
|
1565
1598
|
*
|
|
1566
1599
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1577,6 +1610,7 @@ export declare const concat: {
|
|
|
1577
1610
|
* // 5, 6, 7, 8
|
|
1578
1611
|
* // ]
|
|
1579
1612
|
* // }
|
|
1613
|
+
* ```
|
|
1580
1614
|
*
|
|
1581
1615
|
* @since 2.0.0
|
|
1582
1616
|
* @category constructors
|
|
@@ -1590,6 +1624,7 @@ export declare const concatAll: <A, E, R>(streams: Chunk.Chunk<Stream<A, E, R>>)
|
|
|
1590
1624
|
* See also `Stream.zip` for the more common point-wise variant.
|
|
1591
1625
|
*
|
|
1592
1626
|
* @example
|
|
1627
|
+
* ```ts
|
|
1593
1628
|
* import { Effect, Stream } from "effect"
|
|
1594
1629
|
*
|
|
1595
1630
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1604,6 +1639,7 @@ export declare const concatAll: <A, E, R>(streams: Chunk.Chunk<Stream<A, E, R>>)
|
|
|
1604
1639
|
* // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
|
|
1605
1640
|
* // ]
|
|
1606
1641
|
* // }
|
|
1642
|
+
* ```
|
|
1607
1643
|
*
|
|
1608
1644
|
* @since 2.0.0
|
|
1609
1645
|
* @category utils
|
|
@@ -1617,6 +1653,7 @@ export declare const cross: {
|
|
|
1617
1653
|
* See also `Stream.zip` for the more common point-wise variant.
|
|
1618
1654
|
*
|
|
1619
1655
|
* @example
|
|
1656
|
+
* ```ts
|
|
1620
1657
|
* import { Effect, Stream } from "effect"
|
|
1621
1658
|
*
|
|
1622
1659
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1631,6 +1668,7 @@ export declare const cross: {
|
|
|
1631
1668
|
* // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
|
|
1632
1669
|
* // ]
|
|
1633
1670
|
* // }
|
|
1671
|
+
* ```
|
|
1634
1672
|
*
|
|
1635
1673
|
* @since 2.0.0
|
|
1636
1674
|
* @category utils
|
|
@@ -1644,6 +1682,7 @@ export declare const cross: {
|
|
|
1644
1682
|
* See also `Stream.zip` for the more common point-wise variant.
|
|
1645
1683
|
*
|
|
1646
1684
|
* @example
|
|
1685
|
+
* ```ts
|
|
1647
1686
|
* import { Effect, Stream } from "effect"
|
|
1648
1687
|
*
|
|
1649
1688
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -1658,6 +1697,7 @@ export declare const cross: {
|
|
|
1658
1697
|
* // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
|
|
1659
1698
|
* // ]
|
|
1660
1699
|
* // }
|
|
1700
|
+
* ```
|
|
1661
1701
|
*
|
|
1662
1702
|
* @since 2.0.0
|
|
1663
1703
|
* @category utils
|
|
@@ -1781,6 +1821,7 @@ export declare const crossWith: {
|
|
|
1781
1821
|
* has paused typing so as to not prematurely recommend results.
|
|
1782
1822
|
*
|
|
1783
1823
|
* @example
|
|
1824
|
+
* ```ts
|
|
1784
1825
|
* import { Effect, Stream } from "effect"
|
|
1785
1826
|
*
|
|
1786
1827
|
* let last = Date.now()
|
|
@@ -1818,6 +1859,7 @@ export declare const crossWith: {
|
|
|
1818
1859
|
* // Received 8 after 1ms
|
|
1819
1860
|
* // > Emitted 8 after 101ms
|
|
1820
1861
|
* // { _id: 'Chunk', values: [ 3, 6, 8 ] }
|
|
1862
|
+
* ```
|
|
1821
1863
|
*
|
|
1822
1864
|
* @since 2.0.0
|
|
1823
1865
|
* @category utils
|
|
@@ -1835,6 +1877,7 @@ export declare const debounce: {
|
|
|
1835
1877
|
* has paused typing so as to not prematurely recommend results.
|
|
1836
1878
|
*
|
|
1837
1879
|
* @example
|
|
1880
|
+
* ```ts
|
|
1838
1881
|
* import { Effect, Stream } from "effect"
|
|
1839
1882
|
*
|
|
1840
1883
|
* let last = Date.now()
|
|
@@ -1872,6 +1915,7 @@ export declare const debounce: {
|
|
|
1872
1915
|
* // Received 8 after 1ms
|
|
1873
1916
|
* // > Emitted 8 after 101ms
|
|
1874
1917
|
* // { _id: 'Chunk', values: [ 3, 6, 8 ] }
|
|
1918
|
+
* ```
|
|
1875
1919
|
*
|
|
1876
1920
|
* @since 2.0.0
|
|
1877
1921
|
* @category utils
|
|
@@ -1889,6 +1933,7 @@ export declare const debounce: {
|
|
|
1889
1933
|
* has paused typing so as to not prematurely recommend results.
|
|
1890
1934
|
*
|
|
1891
1935
|
* @example
|
|
1936
|
+
* ```ts
|
|
1892
1937
|
* import { Effect, Stream } from "effect"
|
|
1893
1938
|
*
|
|
1894
1939
|
* let last = Date.now()
|
|
@@ -1926,6 +1971,7 @@ export declare const debounce: {
|
|
|
1926
1971
|
* // Received 8 after 1ms
|
|
1927
1972
|
* // > Emitted 8 after 101ms
|
|
1928
1973
|
* // { _id: 'Chunk', values: [ 3, 6, 8 ] }
|
|
1974
|
+
* ```
|
|
1929
1975
|
*
|
|
1930
1976
|
* @since 2.0.0
|
|
1931
1977
|
* @category utils
|
|
@@ -2037,6 +2083,7 @@ export declare const distributedWithDynamic: {
|
|
|
2037
2083
|
* elements. Useful for sequencing effects using streams:
|
|
2038
2084
|
*
|
|
2039
2085
|
* @example
|
|
2086
|
+
* ```ts
|
|
2040
2087
|
* import { Effect, Stream } from "effect"
|
|
2041
2088
|
*
|
|
2042
2089
|
* // We create a stream and immediately drain it.
|
|
@@ -2044,6 +2091,7 @@ export declare const distributedWithDynamic: {
|
|
|
2044
2091
|
*
|
|
2045
2092
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2046
2093
|
* // { _id: 'Chunk', values: [] }
|
|
2094
|
+
* ```
|
|
2047
2095
|
*
|
|
2048
2096
|
* @since 2.0.0
|
|
2049
2097
|
* @category utils
|
|
@@ -2242,12 +2290,14 @@ export declare const either: <A, E, R>(self: Stream<A, E, R>) => Stream<Either.E
|
|
|
2242
2290
|
* The empty stream.
|
|
2243
2291
|
*
|
|
2244
2292
|
* @example
|
|
2293
|
+
* ```ts
|
|
2245
2294
|
* import { Effect, Stream } from "effect"
|
|
2246
2295
|
*
|
|
2247
2296
|
* const stream = Stream.empty
|
|
2248
2297
|
*
|
|
2249
2298
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2250
2299
|
* // { _id: 'Chunk', values: [] }
|
|
2300
|
+
* ```
|
|
2251
2301
|
*
|
|
2252
2302
|
* @since 2.0.0
|
|
2253
2303
|
* @category constructors
|
|
@@ -2257,6 +2307,7 @@ export declare const empty: Stream<never>;
|
|
|
2257
2307
|
* Executes the provided finalizer after this stream's finalizers run.
|
|
2258
2308
|
*
|
|
2259
2309
|
* @example
|
|
2310
|
+
* ```ts
|
|
2260
2311
|
* import { Console, Effect, Stream } from "effect"
|
|
2261
2312
|
*
|
|
2262
2313
|
* const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
|
|
@@ -2271,6 +2322,7 @@ export declare const empty: Stream<never>;
|
|
|
2271
2322
|
* // Finalizing the stream
|
|
2272
2323
|
* // Doing some other works after stream's finalization
|
|
2273
2324
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2325
|
+
* ```
|
|
2274
2326
|
*
|
|
2275
2327
|
* @since 2.0.0
|
|
2276
2328
|
* @category utils
|
|
@@ -2280,6 +2332,7 @@ export declare const ensuring: {
|
|
|
2280
2332
|
* Executes the provided finalizer after this stream's finalizers run.
|
|
2281
2333
|
*
|
|
2282
2334
|
* @example
|
|
2335
|
+
* ```ts
|
|
2283
2336
|
* import { Console, Effect, Stream } from "effect"
|
|
2284
2337
|
*
|
|
2285
2338
|
* const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
|
|
@@ -2294,6 +2347,7 @@ export declare const ensuring: {
|
|
|
2294
2347
|
* // Finalizing the stream
|
|
2295
2348
|
* // Doing some other works after stream's finalization
|
|
2296
2349
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2350
|
+
* ```
|
|
2297
2351
|
*
|
|
2298
2352
|
* @since 2.0.0
|
|
2299
2353
|
* @category utils
|
|
@@ -2303,6 +2357,7 @@ export declare const ensuring: {
|
|
|
2303
2357
|
* Executes the provided finalizer after this stream's finalizers run.
|
|
2304
2358
|
*
|
|
2305
2359
|
* @example
|
|
2360
|
+
* ```ts
|
|
2306
2361
|
* import { Console, Effect, Stream } from "effect"
|
|
2307
2362
|
*
|
|
2308
2363
|
* const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
|
|
@@ -2317,6 +2372,7 @@ export declare const ensuring: {
|
|
|
2317
2372
|
* // Finalizing the stream
|
|
2318
2373
|
* // Doing some other works after stream's finalization
|
|
2319
2374
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2375
|
+
* ```
|
|
2320
2376
|
*
|
|
2321
2377
|
* @since 2.0.0
|
|
2322
2378
|
* @category utils
|
|
@@ -2384,6 +2440,7 @@ export declare const execute: <X, E, R>(effect: Effect.Effect<X, E, R>) => Strea
|
|
|
2384
2440
|
* Terminates with the specified error.
|
|
2385
2441
|
*
|
|
2386
2442
|
* @example
|
|
2443
|
+
* ```ts
|
|
2387
2444
|
* import { Effect, Stream } from "effect"
|
|
2388
2445
|
*
|
|
2389
2446
|
* const stream = Stream.fail("Uh oh!")
|
|
@@ -2394,6 +2451,7 @@ export declare const execute: <X, E, R>(effect: Effect.Effect<X, E, R>) => Strea
|
|
|
2394
2451
|
* // _tag: 'Failure',
|
|
2395
2452
|
* // cause: { _id: 'Cause', _tag: 'Fail', failure: 'Uh oh!' }
|
|
2396
2453
|
* // }
|
|
2454
|
+
* ```
|
|
2397
2455
|
*
|
|
2398
2456
|
* @since 2.0.0
|
|
2399
2457
|
* @category constructors
|
|
@@ -2424,12 +2482,14 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => St
|
|
|
2424
2482
|
* Filters the elements emitted by this stream using the provided function.
|
|
2425
2483
|
*
|
|
2426
2484
|
* @example
|
|
2485
|
+
* ```ts
|
|
2427
2486
|
* import { Effect, Stream } from "effect"
|
|
2428
2487
|
*
|
|
2429
2488
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2430
2489
|
*
|
|
2431
2490
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2432
2491
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2492
|
+
* ```
|
|
2433
2493
|
*
|
|
2434
2494
|
* @since 2.0.0
|
|
2435
2495
|
* @category filtering
|
|
@@ -2439,12 +2499,14 @@ export declare const filter: {
|
|
|
2439
2499
|
* Filters the elements emitted by this stream using the provided function.
|
|
2440
2500
|
*
|
|
2441
2501
|
* @example
|
|
2502
|
+
* ```ts
|
|
2442
2503
|
* import { Effect, Stream } from "effect"
|
|
2443
2504
|
*
|
|
2444
2505
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2445
2506
|
*
|
|
2446
2507
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2447
2508
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2509
|
+
* ```
|
|
2448
2510
|
*
|
|
2449
2511
|
* @since 2.0.0
|
|
2450
2512
|
* @category filtering
|
|
@@ -2454,12 +2516,14 @@ export declare const filter: {
|
|
|
2454
2516
|
* Filters the elements emitted by this stream using the provided function.
|
|
2455
2517
|
*
|
|
2456
2518
|
* @example
|
|
2519
|
+
* ```ts
|
|
2457
2520
|
* import { Effect, Stream } from "effect"
|
|
2458
2521
|
*
|
|
2459
2522
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2460
2523
|
*
|
|
2461
2524
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2462
2525
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2526
|
+
* ```
|
|
2463
2527
|
*
|
|
2464
2528
|
* @since 2.0.0
|
|
2465
2529
|
* @category filtering
|
|
@@ -2469,12 +2533,14 @@ export declare const filter: {
|
|
|
2469
2533
|
* Filters the elements emitted by this stream using the provided function.
|
|
2470
2534
|
*
|
|
2471
2535
|
* @example
|
|
2536
|
+
* ```ts
|
|
2472
2537
|
* import { Effect, Stream } from "effect"
|
|
2473
2538
|
*
|
|
2474
2539
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2475
2540
|
*
|
|
2476
2541
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2477
2542
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2543
|
+
* ```
|
|
2478
2544
|
*
|
|
2479
2545
|
* @since 2.0.0
|
|
2480
2546
|
* @category filtering
|
|
@@ -2484,12 +2550,14 @@ export declare const filter: {
|
|
|
2484
2550
|
* Filters the elements emitted by this stream using the provided function.
|
|
2485
2551
|
*
|
|
2486
2552
|
* @example
|
|
2553
|
+
* ```ts
|
|
2487
2554
|
* import { Effect, Stream } from "effect"
|
|
2488
2555
|
*
|
|
2489
2556
|
* const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
|
|
2490
2557
|
*
|
|
2491
2558
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2492
2559
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
2560
|
+
* ```
|
|
2493
2561
|
*
|
|
2494
2562
|
* @since 2.0.0
|
|
2495
2563
|
* @category filtering
|
|
@@ -2617,6 +2685,7 @@ export declare const filterMapWhileEffect: {
|
|
|
2617
2685
|
* when it ends.
|
|
2618
2686
|
*
|
|
2619
2687
|
* @example
|
|
2688
|
+
* ```ts
|
|
2620
2689
|
* import { Console, Effect, Stream } from "effect"
|
|
2621
2690
|
*
|
|
2622
2691
|
* const application = Stream.fromEffect(Console.log("Application Logic."))
|
|
@@ -2638,6 +2707,7 @@ export declare const filterMapWhileEffect: {
|
|
|
2638
2707
|
* // Deleting dir: tmp
|
|
2639
2708
|
* // Temporary directory was deleted.
|
|
2640
2709
|
* // { _id: 'Chunk', values: [ undefined, undefined ] }
|
|
2710
|
+
* ```
|
|
2641
2711
|
*
|
|
2642
2712
|
* @since 2.0.0
|
|
2643
2713
|
* @category constructors
|
|
@@ -2852,6 +2922,7 @@ export declare const forever: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R
|
|
|
2852
2922
|
* Creates a stream from an `AsyncIterable`.
|
|
2853
2923
|
*
|
|
2854
2924
|
* @example
|
|
2925
|
+
* ```ts
|
|
2855
2926
|
* import { Effect, Stream } from "effect"
|
|
2856
2927
|
*
|
|
2857
2928
|
* const myAsyncIterable = async function*() {
|
|
@@ -2866,6 +2937,7 @@ export declare const forever: <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R
|
|
|
2866
2937
|
*
|
|
2867
2938
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2868
2939
|
* // { _id: 'Chunk', values: [ 1, 2 ] }
|
|
2940
|
+
* ```
|
|
2869
2941
|
*
|
|
2870
2942
|
* @since 2.0.0
|
|
2871
2943
|
* @category constructors
|
|
@@ -2889,6 +2961,7 @@ export declare const toChannel: <A, E, R>(stream: Stream<A, E, R>) => Channel.Ch
|
|
|
2889
2961
|
* Creates a stream from a `Chunk` of values.
|
|
2890
2962
|
*
|
|
2891
2963
|
* @example
|
|
2964
|
+
* ```ts
|
|
2892
2965
|
* import { Chunk, Effect, Stream } from "effect"
|
|
2893
2966
|
*
|
|
2894
2967
|
* // Creating a stream with values from a single Chunk
|
|
@@ -2896,6 +2969,7 @@ export declare const toChannel: <A, E, R>(stream: Stream<A, E, R>) => Channel.Ch
|
|
|
2896
2969
|
*
|
|
2897
2970
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2898
2971
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
2972
|
+
* ```
|
|
2899
2973
|
*
|
|
2900
2974
|
* @since 2.0.0
|
|
2901
2975
|
* @category constructors
|
|
@@ -2946,6 +3020,7 @@ export declare const fromChunkQueue: <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, o
|
|
|
2946
3020
|
* Creates a stream from an arbitrary number of chunks.
|
|
2947
3021
|
*
|
|
2948
3022
|
* @example
|
|
3023
|
+
* ```ts
|
|
2949
3024
|
* import { Chunk, Effect, Stream } from "effect"
|
|
2950
3025
|
*
|
|
2951
3026
|
* // Creating a stream with values from multiple Chunks
|
|
@@ -2953,6 +3028,7 @@ export declare const fromChunkQueue: <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, o
|
|
|
2953
3028
|
*
|
|
2954
3029
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2955
3030
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
3031
|
+
* ```
|
|
2956
3032
|
*
|
|
2957
3033
|
* @since 2.0.0
|
|
2958
3034
|
* @category constructors
|
|
@@ -2963,12 +3039,14 @@ export declare const fromChunks: <A>(...chunks: Array<Chunk.Chunk<A>>) => Stream
|
|
|
2963
3039
|
* with the failure value of this effect.
|
|
2964
3040
|
*
|
|
2965
3041
|
* @example
|
|
3042
|
+
* ```ts
|
|
2966
3043
|
* import { Effect, Random, Stream } from "effect"
|
|
2967
3044
|
*
|
|
2968
3045
|
* const stream = Stream.fromEffect(Random.nextInt)
|
|
2969
3046
|
*
|
|
2970
3047
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
2971
3048
|
* // Example Output: { _id: 'Chunk', values: [ 922694024 ] }
|
|
3049
|
+
* ```
|
|
2972
3050
|
*
|
|
2973
3051
|
* @since 2.0.0
|
|
2974
3052
|
* @category constructors
|
|
@@ -3026,6 +3104,7 @@ export declare const fromTPubSub: <A>(pubsub: TPubSub<A>) => Stream<A>;
|
|
|
3026
3104
|
* Creates a new `Stream` from an iterable collection of values.
|
|
3027
3105
|
*
|
|
3028
3106
|
* @example
|
|
3107
|
+
* ```ts
|
|
3029
3108
|
* import { Effect, Stream } from "effect"
|
|
3030
3109
|
*
|
|
3031
3110
|
* const numbers = [1, 2, 3]
|
|
@@ -3034,6 +3113,7 @@ export declare const fromTPubSub: <A>(pubsub: TPubSub<A>) => Stream<A>;
|
|
|
3034
3113
|
*
|
|
3035
3114
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3036
3115
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
3116
|
+
* ```
|
|
3037
3117
|
*
|
|
3038
3118
|
* @since 2.0.0
|
|
3039
3119
|
* @category constructors
|
|
@@ -3043,6 +3123,7 @@ export declare const fromIterable: <A>(iterable: Iterable<A>) => Stream<A>;
|
|
|
3043
3123
|
* Creates a stream from an effect producing a value of type `Iterable<A>`.
|
|
3044
3124
|
*
|
|
3045
3125
|
* @example
|
|
3126
|
+
* ```ts
|
|
3046
3127
|
* import { Context, Effect, Stream } from "effect"
|
|
3047
3128
|
*
|
|
3048
3129
|
* class Database extends Context.Tag("Database")<
|
|
@@ -3058,6 +3139,7 @@ export declare const fromIterable: <A>(iterable: Iterable<A>) => Stream<A>;
|
|
|
3058
3139
|
* // Stream.runCollect(stream.pipe(Stream.provideService(Database, { getUsers: Effect.succeed(["user1", "user2"]) })))
|
|
3059
3140
|
* // ).then(console.log)
|
|
3060
3141
|
* // { _id: 'Chunk', values: [ 'user1', 'user2' ] }
|
|
3142
|
+
* ```
|
|
3061
3143
|
*
|
|
3062
3144
|
* @since 2.0.0
|
|
3063
3145
|
* @category constructors
|
|
@@ -3172,6 +3254,7 @@ export declare const fromReadableStreamByob: {
|
|
|
3172
3254
|
* schedule, continuing for as long as the schedule continues.
|
|
3173
3255
|
*
|
|
3174
3256
|
* @example
|
|
3257
|
+
* ```ts
|
|
3175
3258
|
* import { Effect, Schedule, Stream } from "effect"
|
|
3176
3259
|
*
|
|
3177
3260
|
* // Emits values every 1 second for a total of 5 emissions
|
|
@@ -3183,6 +3266,7 @@ export declare const fromReadableStreamByob: {
|
|
|
3183
3266
|
*
|
|
3184
3267
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3185
3268
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
3269
|
+
* ```
|
|
3186
3270
|
*
|
|
3187
3271
|
* @since 2.0.0
|
|
3188
3272
|
* @category constructors
|
|
@@ -3217,6 +3301,7 @@ export declare const groupAdjacentBy: {
|
|
|
3217
3301
|
* More powerful version of `Stream.groupByKey`.
|
|
3218
3302
|
*
|
|
3219
3303
|
* @example
|
|
3304
|
+
* ```ts
|
|
3220
3305
|
* import { Chunk, Effect, GroupBy, Stream } from "effect"
|
|
3221
3306
|
*
|
|
3222
3307
|
* const groupByKeyResult = Stream.fromIterable([
|
|
@@ -3244,6 +3329,7 @@ export declare const groupAdjacentBy: {
|
|
|
3244
3329
|
* // _id: 'Chunk',
|
|
3245
3330
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
3246
3331
|
* // }
|
|
3332
|
+
* ```
|
|
3247
3333
|
*
|
|
3248
3334
|
* @since 2.0.0
|
|
3249
3335
|
* @category grouping
|
|
@@ -3253,6 +3339,7 @@ export declare const groupBy: {
|
|
|
3253
3339
|
* More powerful version of `Stream.groupByKey`.
|
|
3254
3340
|
*
|
|
3255
3341
|
* @example
|
|
3342
|
+
* ```ts
|
|
3256
3343
|
* import { Chunk, Effect, GroupBy, Stream } from "effect"
|
|
3257
3344
|
*
|
|
3258
3345
|
* const groupByKeyResult = Stream.fromIterable([
|
|
@@ -3280,6 +3367,7 @@ export declare const groupBy: {
|
|
|
3280
3367
|
* // _id: 'Chunk',
|
|
3281
3368
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
3282
3369
|
* // }
|
|
3370
|
+
* ```
|
|
3283
3371
|
*
|
|
3284
3372
|
* @since 2.0.0
|
|
3285
3373
|
* @category grouping
|
|
@@ -3291,6 +3379,7 @@ export declare const groupBy: {
|
|
|
3291
3379
|
* More powerful version of `Stream.groupByKey`.
|
|
3292
3380
|
*
|
|
3293
3381
|
* @example
|
|
3382
|
+
* ```ts
|
|
3294
3383
|
* import { Chunk, Effect, GroupBy, Stream } from "effect"
|
|
3295
3384
|
*
|
|
3296
3385
|
* const groupByKeyResult = Stream.fromIterable([
|
|
@@ -3318,6 +3407,7 @@ export declare const groupBy: {
|
|
|
3318
3407
|
* // _id: 'Chunk',
|
|
3319
3408
|
* // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
|
|
3320
3409
|
* // }
|
|
3410
|
+
* ```
|
|
3321
3411
|
*
|
|
3322
3412
|
* @since 2.0.0
|
|
3323
3413
|
* @category grouping
|
|
@@ -3449,6 +3539,7 @@ export declare const groupByKey: {
|
|
|
3449
3539
|
* Partitions the stream with specified `chunkSize`.
|
|
3450
3540
|
*
|
|
3451
3541
|
* @example
|
|
3542
|
+
* ```ts
|
|
3452
3543
|
* import { Effect, Stream } from "effect"
|
|
3453
3544
|
*
|
|
3454
3545
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
@@ -3463,6 +3554,7 @@ export declare const groupByKey: {
|
|
|
3463
3554
|
* // [length]: 3
|
|
3464
3555
|
* // ]
|
|
3465
3556
|
* // }
|
|
3557
|
+
* ```
|
|
3466
3558
|
*
|
|
3467
3559
|
* @since 2.0.0
|
|
3468
3560
|
* @category grouping
|
|
@@ -3472,6 +3564,7 @@ export declare const grouped: {
|
|
|
3472
3564
|
* Partitions the stream with specified `chunkSize`.
|
|
3473
3565
|
*
|
|
3474
3566
|
* @example
|
|
3567
|
+
* ```ts
|
|
3475
3568
|
* import { Effect, Stream } from "effect"
|
|
3476
3569
|
*
|
|
3477
3570
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
@@ -3486,6 +3579,7 @@ export declare const grouped: {
|
|
|
3486
3579
|
* // [length]: 3
|
|
3487
3580
|
* // ]
|
|
3488
3581
|
* // }
|
|
3582
|
+
* ```
|
|
3489
3583
|
*
|
|
3490
3584
|
* @since 2.0.0
|
|
3491
3585
|
* @category grouping
|
|
@@ -3495,6 +3589,7 @@ export declare const grouped: {
|
|
|
3495
3589
|
* Partitions the stream with specified `chunkSize`.
|
|
3496
3590
|
*
|
|
3497
3591
|
* @example
|
|
3592
|
+
* ```ts
|
|
3498
3593
|
* import { Effect, Stream } from "effect"
|
|
3499
3594
|
*
|
|
3500
3595
|
* const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
|
|
@@ -3509,6 +3604,7 @@ export declare const grouped: {
|
|
|
3509
3604
|
* // [length]: 3
|
|
3510
3605
|
* // ]
|
|
3511
3606
|
* // }
|
|
3607
|
+
* ```
|
|
3512
3608
|
*
|
|
3513
3609
|
* @since 2.0.0
|
|
3514
3610
|
* @category grouping
|
|
@@ -3520,6 +3616,7 @@ export declare const grouped: {
|
|
|
3520
3616
|
* `duration` has passed, whichever is satisfied first.
|
|
3521
3617
|
*
|
|
3522
3618
|
* @example
|
|
3619
|
+
* ```ts
|
|
3523
3620
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
3524
3621
|
*
|
|
3525
3622
|
* const stream = Stream.range(0, 9).pipe(
|
|
@@ -3555,6 +3652,7 @@ export declare const grouped: {
|
|
|
3555
3652
|
* // ]
|
|
3556
3653
|
* // }
|
|
3557
3654
|
* // ]
|
|
3655
|
+
* ```
|
|
3558
3656
|
*
|
|
3559
3657
|
* @since 2.0.0
|
|
3560
3658
|
* @category grouping
|
|
@@ -3565,6 +3663,7 @@ export declare const groupedWithin: {
|
|
|
3565
3663
|
* `duration` has passed, whichever is satisfied first.
|
|
3566
3664
|
*
|
|
3567
3665
|
* @example
|
|
3666
|
+
* ```ts
|
|
3568
3667
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
3569
3668
|
*
|
|
3570
3669
|
* const stream = Stream.range(0, 9).pipe(
|
|
@@ -3600,6 +3699,7 @@ export declare const groupedWithin: {
|
|
|
3600
3699
|
* // ]
|
|
3601
3700
|
* // }
|
|
3602
3701
|
* // ]
|
|
3702
|
+
* ```
|
|
3603
3703
|
*
|
|
3604
3704
|
* @since 2.0.0
|
|
3605
3705
|
* @category grouping
|
|
@@ -3610,6 +3710,7 @@ export declare const groupedWithin: {
|
|
|
3610
3710
|
* `duration` has passed, whichever is satisfied first.
|
|
3611
3711
|
*
|
|
3612
3712
|
* @example
|
|
3713
|
+
* ```ts
|
|
3613
3714
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
3614
3715
|
*
|
|
3615
3716
|
* const stream = Stream.range(0, 9).pipe(
|
|
@@ -3645,6 +3746,7 @@ export declare const groupedWithin: {
|
|
|
3645
3746
|
* // ]
|
|
3646
3747
|
* // }
|
|
3647
3748
|
* // ]
|
|
3749
|
+
* ```
|
|
3648
3750
|
*
|
|
3649
3751
|
* @since 2.0.0
|
|
3650
3752
|
* @category grouping
|
|
@@ -3770,6 +3872,7 @@ export declare const identity: <A, E = never, R = never>() => Stream<A, E, R>;
|
|
|
3770
3872
|
* pulled.
|
|
3771
3873
|
*
|
|
3772
3874
|
* @example
|
|
3875
|
+
* ```ts
|
|
3773
3876
|
* import { Effect, Stream } from "effect"
|
|
3774
3877
|
*
|
|
3775
3878
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -3779,6 +3882,7 @@ export declare const identity: <A, E = never, R = never>() => Stream<A, E, R>;
|
|
|
3779
3882
|
*
|
|
3780
3883
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3781
3884
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
3885
|
+
* ```
|
|
3782
3886
|
* @since 2.0.0
|
|
3783
3887
|
* @category utils
|
|
3784
3888
|
*/
|
|
@@ -3790,6 +3894,7 @@ export declare const interleave: {
|
|
|
3790
3894
|
* pulled.
|
|
3791
3895
|
*
|
|
3792
3896
|
* @example
|
|
3897
|
+
* ```ts
|
|
3793
3898
|
* import { Effect, Stream } from "effect"
|
|
3794
3899
|
*
|
|
3795
3900
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -3799,6 +3904,7 @@ export declare const interleave: {
|
|
|
3799
3904
|
*
|
|
3800
3905
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3801
3906
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
3907
|
+
* ```
|
|
3802
3908
|
* @since 2.0.0
|
|
3803
3909
|
* @category utils
|
|
3804
3910
|
*/
|
|
@@ -3810,6 +3916,7 @@ export declare const interleave: {
|
|
|
3810
3916
|
* pulled.
|
|
3811
3917
|
*
|
|
3812
3918
|
* @example
|
|
3919
|
+
* ```ts
|
|
3813
3920
|
* import { Effect, Stream } from "effect"
|
|
3814
3921
|
*
|
|
3815
3922
|
* const s1 = Stream.make(1, 2, 3)
|
|
@@ -3819,6 +3926,7 @@ export declare const interleave: {
|
|
|
3819
3926
|
*
|
|
3820
3927
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
3821
3928
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
|
|
3929
|
+
* ```
|
|
3822
3930
|
* @since 2.0.0
|
|
3823
3931
|
* @category utils
|
|
3824
3932
|
*/
|
|
@@ -3834,6 +3942,7 @@ export declare const interleave: {
|
|
|
3834
3942
|
* ignored.
|
|
3835
3943
|
*
|
|
3836
3944
|
* @example
|
|
3945
|
+
* ```ts
|
|
3837
3946
|
* import { Effect, Stream } from "effect"
|
|
3838
3947
|
*
|
|
3839
3948
|
* const s1 = Stream.make(1, 3, 5, 7, 9)
|
|
@@ -3851,6 +3960,7 @@ export declare const interleave: {
|
|
|
3851
3960
|
* // 8, 5, 10, 7, 9
|
|
3852
3961
|
* // ]
|
|
3853
3962
|
* // }
|
|
3963
|
+
* ```
|
|
3854
3964
|
*
|
|
3855
3965
|
* @since 2.0.0
|
|
3856
3966
|
* @category utils
|
|
@@ -3866,6 +3976,7 @@ export declare const interleaveWith: {
|
|
|
3866
3976
|
* ignored.
|
|
3867
3977
|
*
|
|
3868
3978
|
* @example
|
|
3979
|
+
* ```ts
|
|
3869
3980
|
* import { Effect, Stream } from "effect"
|
|
3870
3981
|
*
|
|
3871
3982
|
* const s1 = Stream.make(1, 3, 5, 7, 9)
|
|
@@ -3883,6 +3994,7 @@ export declare const interleaveWith: {
|
|
|
3883
3994
|
* // 8, 5, 10, 7, 9
|
|
3884
3995
|
* // ]
|
|
3885
3996
|
* // }
|
|
3997
|
+
* ```
|
|
3886
3998
|
*
|
|
3887
3999
|
* @since 2.0.0
|
|
3888
4000
|
* @category utils
|
|
@@ -3898,6 +4010,7 @@ export declare const interleaveWith: {
|
|
|
3898
4010
|
* ignored.
|
|
3899
4011
|
*
|
|
3900
4012
|
* @example
|
|
4013
|
+
* ```ts
|
|
3901
4014
|
* import { Effect, Stream } from "effect"
|
|
3902
4015
|
*
|
|
3903
4016
|
* const s1 = Stream.make(1, 3, 5, 7, 9)
|
|
@@ -3915,6 +4028,7 @@ export declare const interleaveWith: {
|
|
|
3915
4028
|
* // 8, 5, 10, 7, 9
|
|
3916
4029
|
* // ]
|
|
3917
4030
|
* // }
|
|
4031
|
+
* ```
|
|
3918
4032
|
*
|
|
3919
4033
|
* @since 2.0.0
|
|
3920
4034
|
* @category utils
|
|
@@ -3925,6 +4039,7 @@ export declare const interleaveWith: {
|
|
|
3925
4039
|
* Intersperse stream with provided `element`.
|
|
3926
4040
|
*
|
|
3927
4041
|
* @example
|
|
4042
|
+
* ```ts
|
|
3928
4043
|
* import { Effect, Stream } from "effect"
|
|
3929
4044
|
*
|
|
3930
4045
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
@@ -3937,6 +4052,7 @@ export declare const interleaveWith: {
|
|
|
3937
4052
|
* // 0, 4, 0, 5
|
|
3938
4053
|
* // ]
|
|
3939
4054
|
* // }
|
|
4055
|
+
* ```
|
|
3940
4056
|
*
|
|
3941
4057
|
* @since 2.0.0
|
|
3942
4058
|
* @category utils
|
|
@@ -3946,6 +4062,7 @@ export declare const intersperse: {
|
|
|
3946
4062
|
* Intersperse stream with provided `element`.
|
|
3947
4063
|
*
|
|
3948
4064
|
* @example
|
|
4065
|
+
* ```ts
|
|
3949
4066
|
* import { Effect, Stream } from "effect"
|
|
3950
4067
|
*
|
|
3951
4068
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
@@ -3958,6 +4075,7 @@ export declare const intersperse: {
|
|
|
3958
4075
|
* // 0, 4, 0, 5
|
|
3959
4076
|
* // ]
|
|
3960
4077
|
* // }
|
|
4078
|
+
* ```
|
|
3961
4079
|
*
|
|
3962
4080
|
* @since 2.0.0
|
|
3963
4081
|
* @category utils
|
|
@@ -3967,6 +4085,7 @@ export declare const intersperse: {
|
|
|
3967
4085
|
* Intersperse stream with provided `element`.
|
|
3968
4086
|
*
|
|
3969
4087
|
* @example
|
|
4088
|
+
* ```ts
|
|
3970
4089
|
* import { Effect, Stream } from "effect"
|
|
3971
4090
|
*
|
|
3972
4091
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
|
|
@@ -3979,6 +4098,7 @@ export declare const intersperse: {
|
|
|
3979
4098
|
* // 0, 4, 0, 5
|
|
3980
4099
|
* // ]
|
|
3981
4100
|
* // }
|
|
4101
|
+
* ```
|
|
3982
4102
|
*
|
|
3983
4103
|
* @since 2.0.0
|
|
3984
4104
|
* @category utils
|
|
@@ -3989,6 +4109,7 @@ export declare const intersperse: {
|
|
|
3989
4109
|
* Intersperse the specified element, also adding a prefix and a suffix.
|
|
3990
4110
|
*
|
|
3991
4111
|
* @example
|
|
4112
|
+
* ```ts
|
|
3992
4113
|
* import { Effect, Stream } from "effect"
|
|
3993
4114
|
*
|
|
3994
4115
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(
|
|
@@ -4008,6 +4129,7 @@ export declare const intersperse: {
|
|
|
4008
4129
|
* // ']'
|
|
4009
4130
|
* // ]
|
|
4010
4131
|
* // }
|
|
4132
|
+
* ```
|
|
4011
4133
|
*
|
|
4012
4134
|
* @since 2.0.0
|
|
4013
4135
|
* @category utils
|
|
@@ -4017,6 +4139,7 @@ export declare const intersperseAffixes: {
|
|
|
4017
4139
|
* Intersperse the specified element, also adding a prefix and a suffix.
|
|
4018
4140
|
*
|
|
4019
4141
|
* @example
|
|
4142
|
+
* ```ts
|
|
4020
4143
|
* import { Effect, Stream } from "effect"
|
|
4021
4144
|
*
|
|
4022
4145
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(
|
|
@@ -4036,6 +4159,7 @@ export declare const intersperseAffixes: {
|
|
|
4036
4159
|
* // ']'
|
|
4037
4160
|
* // ]
|
|
4038
4161
|
* // }
|
|
4162
|
+
* ```
|
|
4039
4163
|
*
|
|
4040
4164
|
* @since 2.0.0
|
|
4041
4165
|
* @category utils
|
|
@@ -4049,6 +4173,7 @@ export declare const intersperseAffixes: {
|
|
|
4049
4173
|
* Intersperse the specified element, also adding a prefix and a suffix.
|
|
4050
4174
|
*
|
|
4051
4175
|
* @example
|
|
4176
|
+
* ```ts
|
|
4052
4177
|
* import { Effect, Stream } from "effect"
|
|
4053
4178
|
*
|
|
4054
4179
|
* const stream = Stream.make(1, 2, 3, 4, 5).pipe(
|
|
@@ -4068,6 +4193,7 @@ export declare const intersperseAffixes: {
|
|
|
4068
4193
|
* // ']'
|
|
4069
4194
|
* // ]
|
|
4070
4195
|
* // }
|
|
4196
|
+
* ```
|
|
4071
4197
|
*
|
|
4072
4198
|
* @since 2.0.0
|
|
4073
4199
|
* @category utils
|
|
@@ -4182,6 +4308,7 @@ export declare const interruptWhenDeferred: {
|
|
|
4182
4308
|
* f(f(f(a))), ...
|
|
4183
4309
|
*
|
|
4184
4310
|
* @example
|
|
4311
|
+
* ```ts
|
|
4185
4312
|
* import { Effect, Stream } from "effect"
|
|
4186
4313
|
*
|
|
4187
4314
|
* // An infinite Stream of numbers starting from 1 and incrementing
|
|
@@ -4189,6 +4316,7 @@ export declare const interruptWhenDeferred: {
|
|
|
4189
4316
|
*
|
|
4190
4317
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(10)))).then(console.log)
|
|
4191
4318
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }
|
|
4319
|
+
* ```
|
|
4192
4320
|
*
|
|
4193
4321
|
* @since 2.0.0
|
|
4194
4322
|
* @category constructors
|
|
@@ -4198,12 +4326,14 @@ export declare const iterate: <A>(value: A, next: (value: A) => A) => Stream<A>;
|
|
|
4198
4326
|
* Creates a stream from an sequence of values.
|
|
4199
4327
|
*
|
|
4200
4328
|
* @example
|
|
4329
|
+
* ```ts
|
|
4201
4330
|
* import { Effect, Stream } from "effect"
|
|
4202
4331
|
*
|
|
4203
4332
|
* const stream = Stream.make(1, 2, 3)
|
|
4204
4333
|
*
|
|
4205
4334
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4206
4335
|
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
4336
|
+
* ```
|
|
4207
4337
|
*
|
|
4208
4338
|
* @since 2.0.0
|
|
4209
4339
|
* @category constructors
|
|
@@ -4213,12 +4343,14 @@ export declare const make: <As extends Array<any>>(...as: As) => Stream<As[numbe
|
|
|
4213
4343
|
* Transforms the elements of this stream using the supplied function.
|
|
4214
4344
|
*
|
|
4215
4345
|
* @example
|
|
4346
|
+
* ```ts
|
|
4216
4347
|
* import { Effect, Stream } from "effect"
|
|
4217
4348
|
*
|
|
4218
4349
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4219
4350
|
*
|
|
4220
4351
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4221
4352
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4353
|
+
* ```
|
|
4222
4354
|
*
|
|
4223
4355
|
* @since 2.0.0
|
|
4224
4356
|
* @category mapping
|
|
@@ -4228,12 +4360,14 @@ export declare const map: {
|
|
|
4228
4360
|
* Transforms the elements of this stream using the supplied function.
|
|
4229
4361
|
*
|
|
4230
4362
|
* @example
|
|
4363
|
+
* ```ts
|
|
4231
4364
|
* import { Effect, Stream } from "effect"
|
|
4232
4365
|
*
|
|
4233
4366
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4234
4367
|
*
|
|
4235
4368
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4236
4369
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4370
|
+
* ```
|
|
4237
4371
|
*
|
|
4238
4372
|
* @since 2.0.0
|
|
4239
4373
|
* @category mapping
|
|
@@ -4243,12 +4377,14 @@ export declare const map: {
|
|
|
4243
4377
|
* Transforms the elements of this stream using the supplied function.
|
|
4244
4378
|
*
|
|
4245
4379
|
* @example
|
|
4380
|
+
* ```ts
|
|
4246
4381
|
* import { Effect, Stream } from "effect"
|
|
4247
4382
|
*
|
|
4248
4383
|
* const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
|
|
4249
4384
|
*
|
|
4250
4385
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4251
4386
|
* // { _id: 'Chunk', values: [ 2, 3, 4 ] }
|
|
4387
|
+
* ```
|
|
4252
4388
|
*
|
|
4253
4389
|
* @since 2.0.0
|
|
4254
4390
|
* @category mapping
|
|
@@ -4259,6 +4395,7 @@ export declare const map: {
|
|
|
4259
4395
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
4260
4396
|
*
|
|
4261
4397
|
* @example
|
|
4398
|
+
* ```ts
|
|
4262
4399
|
* import { Effect, Stream } from "effect"
|
|
4263
4400
|
*
|
|
4264
4401
|
* const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
|
|
@@ -4269,6 +4406,7 @@ export declare const map: {
|
|
|
4269
4406
|
* // console.log
|
|
4270
4407
|
* // )
|
|
4271
4408
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4409
|
+
* ```
|
|
4272
4410
|
*
|
|
4273
4411
|
* @since 2.0.0
|
|
4274
4412
|
* @category mapping
|
|
@@ -4278,6 +4416,7 @@ export declare const mapAccum: {
|
|
|
4278
4416
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
4279
4417
|
*
|
|
4280
4418
|
* @example
|
|
4419
|
+
* ```ts
|
|
4281
4420
|
* import { Effect, Stream } from "effect"
|
|
4282
4421
|
*
|
|
4283
4422
|
* const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
|
|
@@ -4288,6 +4427,7 @@ export declare const mapAccum: {
|
|
|
4288
4427
|
* // console.log
|
|
4289
4428
|
* // )
|
|
4290
4429
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4430
|
+
* ```
|
|
4291
4431
|
*
|
|
4292
4432
|
* @since 2.0.0
|
|
4293
4433
|
* @category mapping
|
|
@@ -4297,6 +4437,7 @@ export declare const mapAccum: {
|
|
|
4297
4437
|
* Statefully maps over the elements of this stream to produce new elements.
|
|
4298
4438
|
*
|
|
4299
4439
|
* @example
|
|
4440
|
+
* ```ts
|
|
4300
4441
|
* import { Effect, Stream } from "effect"
|
|
4301
4442
|
*
|
|
4302
4443
|
* const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
|
|
@@ -4307,6 +4448,7 @@ export declare const mapAccum: {
|
|
|
4307
4448
|
* // console.log
|
|
4308
4449
|
* // )
|
|
4309
4450
|
* // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
4451
|
+
* ```
|
|
4310
4452
|
*
|
|
4311
4453
|
* @since 2.0.0
|
|
4312
4454
|
* @category mapping
|
|
@@ -4418,6 +4560,7 @@ export declare const mapChunksEffect: {
|
|
|
4418
4560
|
* output of this stream.
|
|
4419
4561
|
*
|
|
4420
4562
|
* @example
|
|
4563
|
+
* ```ts
|
|
4421
4564
|
* import { Effect, Stream } from "effect"
|
|
4422
4565
|
*
|
|
4423
4566
|
* const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
|
|
@@ -4427,6 +4570,7 @@ export declare const mapChunksEffect: {
|
|
|
4427
4570
|
*
|
|
4428
4571
|
* // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4429
4572
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4573
|
+
* ```
|
|
4430
4574
|
*
|
|
4431
4575
|
* @since 2.0.0
|
|
4432
4576
|
* @category mapping
|
|
@@ -4437,6 +4581,7 @@ export declare const mapConcat: {
|
|
|
4437
4581
|
* output of this stream.
|
|
4438
4582
|
*
|
|
4439
4583
|
* @example
|
|
4584
|
+
* ```ts
|
|
4440
4585
|
* import { Effect, Stream } from "effect"
|
|
4441
4586
|
*
|
|
4442
4587
|
* const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
|
|
@@ -4446,6 +4591,7 @@ export declare const mapConcat: {
|
|
|
4446
4591
|
*
|
|
4447
4592
|
* // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4448
4593
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4594
|
+
* ```
|
|
4449
4595
|
*
|
|
4450
4596
|
* @since 2.0.0
|
|
4451
4597
|
* @category mapping
|
|
@@ -4456,6 +4602,7 @@ export declare const mapConcat: {
|
|
|
4456
4602
|
* output of this stream.
|
|
4457
4603
|
*
|
|
4458
4604
|
* @example
|
|
4605
|
+
* ```ts
|
|
4459
4606
|
* import { Effect, Stream } from "effect"
|
|
4460
4607
|
*
|
|
4461
4608
|
* const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
|
|
@@ -4465,6 +4612,7 @@ export declare const mapConcat: {
|
|
|
4465
4612
|
*
|
|
4466
4613
|
* // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
|
|
4467
4614
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
|
|
4615
|
+
* ```
|
|
4468
4616
|
*
|
|
4469
4617
|
* @since 2.0.0
|
|
4470
4618
|
* @category mapping
|
|
@@ -4550,6 +4698,7 @@ export declare const mapConcatEffect: {
|
|
|
4550
4698
|
* Maps over elements of the stream with the specified effectful function.
|
|
4551
4699
|
*
|
|
4552
4700
|
* @example
|
|
4701
|
+
* ```ts
|
|
4553
4702
|
* import { Effect, Random, Stream } from "effect"
|
|
4554
4703
|
*
|
|
4555
4704
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4558,6 +4707,7 @@ export declare const mapConcatEffect: {
|
|
|
4558
4707
|
*
|
|
4559
4708
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4560
4709
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4710
|
+
* ```
|
|
4561
4711
|
*
|
|
4562
4712
|
* @since 2.0.0
|
|
4563
4713
|
* @category mapping
|
|
@@ -4567,6 +4717,7 @@ export declare const mapEffect: {
|
|
|
4567
4717
|
* Maps over elements of the stream with the specified effectful function.
|
|
4568
4718
|
*
|
|
4569
4719
|
* @example
|
|
4720
|
+
* ```ts
|
|
4570
4721
|
* import { Effect, Random, Stream } from "effect"
|
|
4571
4722
|
*
|
|
4572
4723
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4575,6 +4726,7 @@ export declare const mapEffect: {
|
|
|
4575
4726
|
*
|
|
4576
4727
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4577
4728
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4729
|
+
* ```
|
|
4578
4730
|
*
|
|
4579
4731
|
* @since 2.0.0
|
|
4580
4732
|
* @category mapping
|
|
@@ -4587,6 +4739,7 @@ export declare const mapEffect: {
|
|
|
4587
4739
|
* Maps over elements of the stream with the specified effectful function.
|
|
4588
4740
|
*
|
|
4589
4741
|
* @example
|
|
4742
|
+
* ```ts
|
|
4590
4743
|
* import { Effect, Random, Stream } from "effect"
|
|
4591
4744
|
*
|
|
4592
4745
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4595,6 +4748,7 @@ export declare const mapEffect: {
|
|
|
4595
4748
|
*
|
|
4596
4749
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4597
4750
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4751
|
+
* ```
|
|
4598
4752
|
*
|
|
4599
4753
|
* @since 2.0.0
|
|
4600
4754
|
* @category mapping
|
|
@@ -4607,6 +4761,7 @@ export declare const mapEffect: {
|
|
|
4607
4761
|
* Maps over elements of the stream with the specified effectful function.
|
|
4608
4762
|
*
|
|
4609
4763
|
* @example
|
|
4764
|
+
* ```ts
|
|
4610
4765
|
* import { Effect, Random, Stream } from "effect"
|
|
4611
4766
|
*
|
|
4612
4767
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4615,6 +4770,7 @@ export declare const mapEffect: {
|
|
|
4615
4770
|
*
|
|
4616
4771
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4617
4772
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4773
|
+
* ```
|
|
4618
4774
|
*
|
|
4619
4775
|
* @since 2.0.0
|
|
4620
4776
|
* @category mapping
|
|
@@ -4627,6 +4783,7 @@ export declare const mapEffect: {
|
|
|
4627
4783
|
* Maps over elements of the stream with the specified effectful function.
|
|
4628
4784
|
*
|
|
4629
4785
|
* @example
|
|
4786
|
+
* ```ts
|
|
4630
4787
|
* import { Effect, Random, Stream } from "effect"
|
|
4631
4788
|
*
|
|
4632
4789
|
* const stream = Stream.make(10, 20, 30).pipe(
|
|
@@ -4635,6 +4792,7 @@ export declare const mapEffect: {
|
|
|
4635
4792
|
*
|
|
4636
4793
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4637
4794
|
* // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
|
|
4795
|
+
* ```
|
|
4638
4796
|
*
|
|
4639
4797
|
* @since 2.0.0
|
|
4640
4798
|
* @category mapping
|
|
@@ -4695,6 +4853,7 @@ export declare const mapErrorCause: {
|
|
|
4695
4853
|
* no termination strategy is specified.
|
|
4696
4854
|
*
|
|
4697
4855
|
* @example
|
|
4856
|
+
* ```ts
|
|
4698
4857
|
* import { Effect, Schedule, Stream } from "effect"
|
|
4699
4858
|
*
|
|
4700
4859
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -4708,6 +4867,7 @@ export declare const mapErrorCause: {
|
|
|
4708
4867
|
*
|
|
4709
4868
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4710
4869
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
4870
|
+
* ```
|
|
4711
4871
|
*
|
|
4712
4872
|
* @since 2.0.0
|
|
4713
4873
|
* @category utils
|
|
@@ -4720,6 +4880,7 @@ export declare const merge: {
|
|
|
4720
4880
|
* no termination strategy is specified.
|
|
4721
4881
|
*
|
|
4722
4882
|
* @example
|
|
4883
|
+
* ```ts
|
|
4723
4884
|
* import { Effect, Schedule, Stream } from "effect"
|
|
4724
4885
|
*
|
|
4725
4886
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -4733,6 +4894,7 @@ export declare const merge: {
|
|
|
4733
4894
|
*
|
|
4734
4895
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4735
4896
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
4897
|
+
* ```
|
|
4736
4898
|
*
|
|
4737
4899
|
* @since 2.0.0
|
|
4738
4900
|
* @category utils
|
|
@@ -4747,6 +4909,7 @@ export declare const merge: {
|
|
|
4747
4909
|
* no termination strategy is specified.
|
|
4748
4910
|
*
|
|
4749
4911
|
* @example
|
|
4912
|
+
* ```ts
|
|
4750
4913
|
* import { Effect, Schedule, Stream } from "effect"
|
|
4751
4914
|
*
|
|
4752
4915
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -4760,6 +4923,7 @@ export declare const merge: {
|
|
|
4760
4923
|
*
|
|
4761
4924
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4762
4925
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
4926
|
+
* ```
|
|
4763
4927
|
*
|
|
4764
4928
|
* @since 2.0.0
|
|
4765
4929
|
* @category utils
|
|
@@ -4808,12 +4972,14 @@ export declare const mergeAll: {
|
|
|
4808
4972
|
* @since 3.8.5
|
|
4809
4973
|
*
|
|
4810
4974
|
* @example
|
|
4975
|
+
* ```ts
|
|
4811
4976
|
* import { Stream } from "effect"
|
|
4812
4977
|
* // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
|
|
4813
4978
|
* const res = Stream.mergeWithTag({
|
|
4814
4979
|
* a: Stream.make(0),
|
|
4815
4980
|
* b: Stream.make("")
|
|
4816
4981
|
* }, { concurrency: "unbounded" })
|
|
4982
|
+
* ```
|
|
4817
4983
|
*/
|
|
4818
4984
|
export declare const mergeWithTag: {
|
|
4819
4985
|
/**
|
|
@@ -4822,12 +4988,14 @@ export declare const mergeWithTag: {
|
|
|
4822
4988
|
* @since 3.8.5
|
|
4823
4989
|
*
|
|
4824
4990
|
* @example
|
|
4991
|
+
* ```ts
|
|
4825
4992
|
* import { Stream } from "effect"
|
|
4826
4993
|
* // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
|
|
4827
4994
|
* const res = Stream.mergeWithTag({
|
|
4828
4995
|
* a: Stream.make(0),
|
|
4829
4996
|
* b: Stream.make("")
|
|
4830
4997
|
* }, { concurrency: "unbounded" })
|
|
4998
|
+
* ```
|
|
4831
4999
|
*/
|
|
4832
5000
|
<S extends {
|
|
4833
5001
|
[k in string]: Stream<any, any, any>;
|
|
@@ -4846,12 +5014,14 @@ export declare const mergeWithTag: {
|
|
|
4846
5014
|
* @since 3.8.5
|
|
4847
5015
|
*
|
|
4848
5016
|
* @example
|
|
5017
|
+
* ```ts
|
|
4849
5018
|
* import { Stream } from "effect"
|
|
4850
5019
|
* // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
|
|
4851
5020
|
* const res = Stream.mergeWithTag({
|
|
4852
5021
|
* a: Stream.make(0),
|
|
4853
5022
|
* b: Stream.make("")
|
|
4854
5023
|
* }, { concurrency: "unbounded" })
|
|
5024
|
+
* ```
|
|
4855
5025
|
*/
|
|
4856
5026
|
(options: {
|
|
4857
5027
|
readonly concurrency: number | "unbounded";
|
|
@@ -4873,6 +5043,7 @@ export declare const mergeWithTag: {
|
|
|
4873
5043
|
* no termination strategy is specified.
|
|
4874
5044
|
*
|
|
4875
5045
|
* @example
|
|
5046
|
+
* ```ts
|
|
4876
5047
|
* import { Effect, Schedule, Stream } from "effect"
|
|
4877
5048
|
*
|
|
4878
5049
|
* const s1 = Stream.make("1", "2", "3").pipe(
|
|
@@ -4889,6 +5060,7 @@ export declare const mergeWithTag: {
|
|
|
4889
5060
|
*
|
|
4890
5061
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4891
5062
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5063
|
+
* ```
|
|
4892
5064
|
*
|
|
4893
5065
|
* @since 2.0.0
|
|
4894
5066
|
* @category utils
|
|
@@ -4902,6 +5074,7 @@ export declare const mergeWith: {
|
|
|
4902
5074
|
* no termination strategy is specified.
|
|
4903
5075
|
*
|
|
4904
5076
|
* @example
|
|
5077
|
+
* ```ts
|
|
4905
5078
|
* import { Effect, Schedule, Stream } from "effect"
|
|
4906
5079
|
*
|
|
4907
5080
|
* const s1 = Stream.make("1", "2", "3").pipe(
|
|
@@ -4918,6 +5091,7 @@ export declare const mergeWith: {
|
|
|
4918
5091
|
*
|
|
4919
5092
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4920
5093
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5094
|
+
* ```
|
|
4921
5095
|
*
|
|
4922
5096
|
* @since 2.0.0
|
|
4923
5097
|
* @category utils
|
|
@@ -4935,6 +5109,7 @@ export declare const mergeWith: {
|
|
|
4935
5109
|
* no termination strategy is specified.
|
|
4936
5110
|
*
|
|
4937
5111
|
* @example
|
|
5112
|
+
* ```ts
|
|
4938
5113
|
* import { Effect, Schedule, Stream } from "effect"
|
|
4939
5114
|
*
|
|
4940
5115
|
* const s1 = Stream.make("1", "2", "3").pipe(
|
|
@@ -4951,6 +5126,7 @@ export declare const mergeWith: {
|
|
|
4951
5126
|
*
|
|
4952
5127
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
4953
5128
|
* // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
|
|
5129
|
+
* ```
|
|
4954
5130
|
*
|
|
4955
5131
|
* @since 2.0.0
|
|
4956
5132
|
* @category utils
|
|
@@ -5055,6 +5231,7 @@ export declare const never: Stream<never>;
|
|
|
5055
5231
|
* Adds an effect to be executed at the end of the stream.
|
|
5056
5232
|
*
|
|
5057
5233
|
* @example
|
|
5234
|
+
* ```ts
|
|
5058
5235
|
* import { Console, Effect, Stream } from "effect"
|
|
5059
5236
|
*
|
|
5060
5237
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5069,6 +5246,7 @@ export declare const never: Stream<never>;
|
|
|
5069
5246
|
* // after mapping: 6
|
|
5070
5247
|
* // Stream ended
|
|
5071
5248
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5249
|
+
* ```
|
|
5072
5250
|
*
|
|
5073
5251
|
* @since 3.6.0
|
|
5074
5252
|
* @category sequencing
|
|
@@ -5078,6 +5256,7 @@ export declare const onEnd: {
|
|
|
5078
5256
|
* Adds an effect to be executed at the end of the stream.
|
|
5079
5257
|
*
|
|
5080
5258
|
* @example
|
|
5259
|
+
* ```ts
|
|
5081
5260
|
* import { Console, Effect, Stream } from "effect"
|
|
5082
5261
|
*
|
|
5083
5262
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5092,6 +5271,7 @@ export declare const onEnd: {
|
|
|
5092
5271
|
* // after mapping: 6
|
|
5093
5272
|
* // Stream ended
|
|
5094
5273
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5274
|
+
* ```
|
|
5095
5275
|
*
|
|
5096
5276
|
* @since 3.6.0
|
|
5097
5277
|
* @category sequencing
|
|
@@ -5101,6 +5281,7 @@ export declare const onEnd: {
|
|
|
5101
5281
|
* Adds an effect to be executed at the end of the stream.
|
|
5102
5282
|
*
|
|
5103
5283
|
* @example
|
|
5284
|
+
* ```ts
|
|
5104
5285
|
* import { Console, Effect, Stream } from "effect"
|
|
5105
5286
|
*
|
|
5106
5287
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5115,6 +5296,7 @@ export declare const onEnd: {
|
|
|
5115
5296
|
* // after mapping: 6
|
|
5116
5297
|
* // Stream ended
|
|
5117
5298
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5299
|
+
* ```
|
|
5118
5300
|
*
|
|
5119
5301
|
* @since 3.6.0
|
|
5120
5302
|
* @category sequencing
|
|
@@ -5181,6 +5363,7 @@ export declare const onDone: {
|
|
|
5181
5363
|
* Adds an effect to be executed at the start of the stream.
|
|
5182
5364
|
*
|
|
5183
5365
|
* @example
|
|
5366
|
+
* ```ts
|
|
5184
5367
|
* import { Console, Effect, Stream } from "effect"
|
|
5185
5368
|
*
|
|
5186
5369
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5195,6 +5378,7 @@ export declare const onDone: {
|
|
|
5195
5378
|
* // after mapping: 4
|
|
5196
5379
|
* // after mapping: 6
|
|
5197
5380
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5381
|
+
* ```
|
|
5198
5382
|
*
|
|
5199
5383
|
* @since 3.6.0
|
|
5200
5384
|
* @category sequencing
|
|
@@ -5204,6 +5388,7 @@ export declare const onStart: {
|
|
|
5204
5388
|
* Adds an effect to be executed at the start of the stream.
|
|
5205
5389
|
*
|
|
5206
5390
|
* @example
|
|
5391
|
+
* ```ts
|
|
5207
5392
|
* import { Console, Effect, Stream } from "effect"
|
|
5208
5393
|
*
|
|
5209
5394
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5218,6 +5403,7 @@ export declare const onStart: {
|
|
|
5218
5403
|
* // after mapping: 4
|
|
5219
5404
|
* // after mapping: 6
|
|
5220
5405
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5406
|
+
* ```
|
|
5221
5407
|
*
|
|
5222
5408
|
* @since 3.6.0
|
|
5223
5409
|
* @category sequencing
|
|
@@ -5227,6 +5413,7 @@ export declare const onStart: {
|
|
|
5227
5413
|
* Adds an effect to be executed at the start of the stream.
|
|
5228
5414
|
*
|
|
5229
5415
|
* @example
|
|
5416
|
+
* ```ts
|
|
5230
5417
|
* import { Console, Effect, Stream } from "effect"
|
|
5231
5418
|
*
|
|
5232
5419
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -5241,6 +5428,7 @@ export declare const onStart: {
|
|
|
5241
5428
|
* // after mapping: 4
|
|
5242
5429
|
* // after mapping: 6
|
|
5243
5430
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
5431
|
+
* ```
|
|
5244
5432
|
*
|
|
5245
5433
|
* @since 3.6.0
|
|
5246
5434
|
* @category sequencing
|
|
@@ -5458,6 +5646,7 @@ export declare const orElseSucceed: {
|
|
|
5458
5646
|
* APIs, hence the name.
|
|
5459
5647
|
*
|
|
5460
5648
|
* @example
|
|
5649
|
+
* ```ts
|
|
5461
5650
|
* import { Effect, Option, Stream } from "effect"
|
|
5462
5651
|
*
|
|
5463
5652
|
* const stream = Stream.paginate(0, (n) => [
|
|
@@ -5467,6 +5656,7 @@ export declare const orElseSucceed: {
|
|
|
5467
5656
|
*
|
|
5468
5657
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
5469
5658
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3 ] }
|
|
5659
|
+
* ```
|
|
5470
5660
|
*
|
|
5471
5661
|
* @since 2.0.0
|
|
5472
5662
|
* @category constructors
|
|
@@ -5501,11 +5691,12 @@ export declare const paginateChunkEffect: <S, A, E, R>(s: S, f: (s: S) => Effect
|
|
|
5501
5691
|
export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effect<readonly [A, Option.Option<S>], E, R>) => Stream<A, E, R>;
|
|
5502
5692
|
/**
|
|
5503
5693
|
* Partition a stream using a predicate. The first stream will contain all
|
|
5504
|
-
* element evaluated to
|
|
5505
|
-
* evaluated to
|
|
5694
|
+
* element evaluated to false and the second one will contain all element
|
|
5695
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
5506
5696
|
* further than the slower one.
|
|
5507
5697
|
*
|
|
5508
5698
|
* @example
|
|
5699
|
+
* ```ts
|
|
5509
5700
|
* import { Effect, Stream } from "effect"
|
|
5510
5701
|
*
|
|
5511
5702
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -5514,15 +5705,16 @@ export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effe
|
|
|
5514
5705
|
*
|
|
5515
5706
|
* const program = Effect.scoped(
|
|
5516
5707
|
* Effect.gen(function*() {
|
|
5517
|
-
* const [
|
|
5518
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5708
|
+
* const [odds, evens] = yield* partition
|
|
5519
5709
|
* console.log(yield* Stream.runCollect(odds))
|
|
5710
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5520
5711
|
* })
|
|
5521
5712
|
* )
|
|
5522
5713
|
*
|
|
5523
5714
|
* // Effect.runPromise(program)
|
|
5524
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5525
5715
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5716
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5717
|
+
* ```
|
|
5526
5718
|
*
|
|
5527
5719
|
* @since 2.0.0
|
|
5528
5720
|
* @category utils
|
|
@@ -5530,11 +5722,12 @@ export declare const paginateEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.Effe
|
|
|
5530
5722
|
export declare const partition: {
|
|
5531
5723
|
/**
|
|
5532
5724
|
* Partition a stream using a predicate. The first stream will contain all
|
|
5533
|
-
* element evaluated to
|
|
5534
|
-
* evaluated to
|
|
5725
|
+
* element evaluated to false and the second one will contain all element
|
|
5726
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
5535
5727
|
* further than the slower one.
|
|
5536
5728
|
*
|
|
5537
5729
|
* @example
|
|
5730
|
+
* ```ts
|
|
5538
5731
|
* import { Effect, Stream } from "effect"
|
|
5539
5732
|
*
|
|
5540
5733
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -5543,15 +5736,16 @@ export declare const partition: {
|
|
|
5543
5736
|
*
|
|
5544
5737
|
* const program = Effect.scoped(
|
|
5545
5738
|
* Effect.gen(function*() {
|
|
5546
|
-
* const [
|
|
5547
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5739
|
+
* const [odds, evens] = yield* partition
|
|
5548
5740
|
* console.log(yield* Stream.runCollect(odds))
|
|
5741
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5549
5742
|
* })
|
|
5550
5743
|
* )
|
|
5551
5744
|
*
|
|
5552
5745
|
* // Effect.runPromise(program)
|
|
5553
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5554
5746
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5747
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5748
|
+
* ```
|
|
5555
5749
|
*
|
|
5556
5750
|
* @since 2.0.0
|
|
5557
5751
|
* @category utils
|
|
@@ -5561,11 +5755,12 @@ export declare const partition: {
|
|
|
5561
5755
|
} | undefined): <E, R>(self: Stream<C, E, R>) => Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>;
|
|
5562
5756
|
/**
|
|
5563
5757
|
* Partition a stream using a predicate. The first stream will contain all
|
|
5564
|
-
* element evaluated to
|
|
5565
|
-
* evaluated to
|
|
5758
|
+
* element evaluated to false and the second one will contain all element
|
|
5759
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
5566
5760
|
* further than the slower one.
|
|
5567
5761
|
*
|
|
5568
5762
|
* @example
|
|
5763
|
+
* ```ts
|
|
5569
5764
|
* import { Effect, Stream } from "effect"
|
|
5570
5765
|
*
|
|
5571
5766
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -5574,15 +5769,16 @@ export declare const partition: {
|
|
|
5574
5769
|
*
|
|
5575
5770
|
* const program = Effect.scoped(
|
|
5576
5771
|
* Effect.gen(function*() {
|
|
5577
|
-
* const [
|
|
5578
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5772
|
+
* const [odds, evens] = yield* partition
|
|
5579
5773
|
* console.log(yield* Stream.runCollect(odds))
|
|
5774
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5580
5775
|
* })
|
|
5581
5776
|
* )
|
|
5582
5777
|
*
|
|
5583
5778
|
* // Effect.runPromise(program)
|
|
5584
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5585
5779
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5780
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5781
|
+
* ```
|
|
5586
5782
|
*
|
|
5587
5783
|
* @since 2.0.0
|
|
5588
5784
|
* @category utils
|
|
@@ -5592,11 +5788,12 @@ export declare const partition: {
|
|
|
5592
5788
|
} | undefined): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[excluded: Stream<A, E, never>, satisfying: Stream<A, E, never>], E, Scope.Scope | R>;
|
|
5593
5789
|
/**
|
|
5594
5790
|
* Partition a stream using a predicate. The first stream will contain all
|
|
5595
|
-
* element evaluated to
|
|
5596
|
-
* evaluated to
|
|
5791
|
+
* element evaluated to false and the second one will contain all element
|
|
5792
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
5597
5793
|
* further than the slower one.
|
|
5598
5794
|
*
|
|
5599
5795
|
* @example
|
|
5796
|
+
* ```ts
|
|
5600
5797
|
* import { Effect, Stream } from "effect"
|
|
5601
5798
|
*
|
|
5602
5799
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -5605,15 +5802,16 @@ export declare const partition: {
|
|
|
5605
5802
|
*
|
|
5606
5803
|
* const program = Effect.scoped(
|
|
5607
5804
|
* Effect.gen(function*() {
|
|
5608
|
-
* const [
|
|
5609
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5805
|
+
* const [odds, evens] = yield* partition
|
|
5610
5806
|
* console.log(yield* Stream.runCollect(odds))
|
|
5807
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5611
5808
|
* })
|
|
5612
5809
|
* )
|
|
5613
5810
|
*
|
|
5614
5811
|
* // Effect.runPromise(program)
|
|
5615
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5616
5812
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5813
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5814
|
+
* ```
|
|
5617
5815
|
*
|
|
5618
5816
|
* @since 2.0.0
|
|
5619
5817
|
* @category utils
|
|
@@ -5623,11 +5821,12 @@ export declare const partition: {
|
|
|
5623
5821
|
} | undefined): Effect.Effect<[excluded: Stream<Exclude<C, B>, E, never>, satisfying: Stream<B, E, never>], E, R | Scope.Scope>;
|
|
5624
5822
|
/**
|
|
5625
5823
|
* Partition a stream using a predicate. The first stream will contain all
|
|
5626
|
-
* element evaluated to
|
|
5627
|
-
* evaluated to
|
|
5824
|
+
* element evaluated to false and the second one will contain all element
|
|
5825
|
+
* evaluated to true. The faster stream may advance by up to buffer elements
|
|
5628
5826
|
* further than the slower one.
|
|
5629
5827
|
*
|
|
5630
5828
|
* @example
|
|
5829
|
+
* ```ts
|
|
5631
5830
|
* import { Effect, Stream } from "effect"
|
|
5632
5831
|
*
|
|
5633
5832
|
* const partition = Stream.range(1, 10).pipe(
|
|
@@ -5636,15 +5835,16 @@ export declare const partition: {
|
|
|
5636
5835
|
*
|
|
5637
5836
|
* const program = Effect.scoped(
|
|
5638
5837
|
* Effect.gen(function*() {
|
|
5639
|
-
* const [
|
|
5640
|
-
* console.log(yield* Stream.runCollect(evens))
|
|
5838
|
+
* const [odds, evens] = yield* partition
|
|
5641
5839
|
* console.log(yield* Stream.runCollect(odds))
|
|
5840
|
+
* console.log(yield* Stream.runCollect(evens))
|
|
5642
5841
|
* })
|
|
5643
5842
|
* )
|
|
5644
5843
|
*
|
|
5645
5844
|
* // Effect.runPromise(program)
|
|
5646
|
-
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5647
5845
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5846
|
+
* // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
|
|
5847
|
+
* ```
|
|
5648
5848
|
*
|
|
5649
5849
|
* @since 2.0.0
|
|
5650
5850
|
* @category utils
|
|
@@ -5658,6 +5858,7 @@ export declare const partition: {
|
|
|
5658
5858
|
* up to buffer elements further than the slower one.
|
|
5659
5859
|
*
|
|
5660
5860
|
* @example
|
|
5861
|
+
* ```ts
|
|
5661
5862
|
* import { Effect, Either, Stream } from "effect"
|
|
5662
5863
|
*
|
|
5663
5864
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5678,6 +5879,7 @@ export declare const partition: {
|
|
|
5678
5879
|
* // Effect.runPromise(program)
|
|
5679
5880
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5680
5881
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5882
|
+
* ```
|
|
5681
5883
|
*
|
|
5682
5884
|
* @since 2.0.0
|
|
5683
5885
|
* @category utils
|
|
@@ -5688,6 +5890,7 @@ export declare const partitionEither: {
|
|
|
5688
5890
|
* up to buffer elements further than the slower one.
|
|
5689
5891
|
*
|
|
5690
5892
|
* @example
|
|
5893
|
+
* ```ts
|
|
5691
5894
|
* import { Effect, Either, Stream } from "effect"
|
|
5692
5895
|
*
|
|
5693
5896
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5708,6 +5911,7 @@ export declare const partitionEither: {
|
|
|
5708
5911
|
* // Effect.runPromise(program)
|
|
5709
5912
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5710
5913
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5914
|
+
* ```
|
|
5711
5915
|
*
|
|
5712
5916
|
* @since 2.0.0
|
|
5713
5917
|
* @category utils
|
|
@@ -5720,6 +5924,7 @@ export declare const partitionEither: {
|
|
|
5720
5924
|
* up to buffer elements further than the slower one.
|
|
5721
5925
|
*
|
|
5722
5926
|
* @example
|
|
5927
|
+
* ```ts
|
|
5723
5928
|
* import { Effect, Either, Stream } from "effect"
|
|
5724
5929
|
*
|
|
5725
5930
|
* const partition = Stream.range(1, 9).pipe(
|
|
@@ -5740,6 +5945,7 @@ export declare const partitionEither: {
|
|
|
5740
5945
|
* // Effect.runPromise(program)
|
|
5741
5946
|
* // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
|
|
5742
5947
|
* // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
|
|
5948
|
+
* ```
|
|
5743
5949
|
*
|
|
5744
5950
|
* @since 2.0.0
|
|
5745
5951
|
* @category utils
|
|
@@ -6055,6 +6261,7 @@ export declare const provideSomeLayer: {
|
|
|
6055
6261
|
* Any upstream failures will cause the returned stream to fail.
|
|
6056
6262
|
*
|
|
6057
6263
|
* @example
|
|
6264
|
+
* ```ts
|
|
6058
6265
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6059
6266
|
*
|
|
6060
6267
|
* const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
|
|
@@ -6071,6 +6278,7 @@ export declare const provideSomeLayer: {
|
|
|
6071
6278
|
* // 3
|
|
6072
6279
|
* // 4
|
|
6073
6280
|
* // 5
|
|
6281
|
+
* ```
|
|
6074
6282
|
* @since 3.7.0
|
|
6075
6283
|
* @category racing
|
|
6076
6284
|
*/
|
|
@@ -6082,6 +6290,7 @@ export declare const race: {
|
|
|
6082
6290
|
* Any upstream failures will cause the returned stream to fail.
|
|
6083
6291
|
*
|
|
6084
6292
|
* @example
|
|
6293
|
+
* ```ts
|
|
6085
6294
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6086
6295
|
*
|
|
6087
6296
|
* const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
|
|
@@ -6098,6 +6307,7 @@ export declare const race: {
|
|
|
6098
6307
|
* // 3
|
|
6099
6308
|
* // 4
|
|
6100
6309
|
* // 5
|
|
6310
|
+
* ```
|
|
6101
6311
|
* @since 3.7.0
|
|
6102
6312
|
* @category racing
|
|
6103
6313
|
*/
|
|
@@ -6109,6 +6319,7 @@ export declare const race: {
|
|
|
6109
6319
|
* Any upstream failures will cause the returned stream to fail.
|
|
6110
6320
|
*
|
|
6111
6321
|
* @example
|
|
6322
|
+
* ```ts
|
|
6112
6323
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6113
6324
|
*
|
|
6114
6325
|
* const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
|
|
@@ -6125,6 +6336,7 @@ export declare const race: {
|
|
|
6125
6336
|
* // 3
|
|
6126
6337
|
* // 4
|
|
6127
6338
|
* // 5
|
|
6339
|
+
* ```
|
|
6128
6340
|
* @since 3.7.0
|
|
6129
6341
|
* @category racing
|
|
6130
6342
|
*/
|
|
@@ -6137,6 +6349,7 @@ export declare const race: {
|
|
|
6137
6349
|
* Any upstream failures will cause the returned stream to fail.
|
|
6138
6350
|
*
|
|
6139
6351
|
* @example
|
|
6352
|
+
* ```ts
|
|
6140
6353
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
6141
6354
|
*
|
|
6142
6355
|
* const stream = Stream.raceAll(
|
|
@@ -6153,6 +6366,7 @@ export declare const race: {
|
|
|
6153
6366
|
* // 3
|
|
6154
6367
|
* // 4
|
|
6155
6368
|
* // 5
|
|
6369
|
+
* ```
|
|
6156
6370
|
* @since 3.5.0
|
|
6157
6371
|
* @category racing
|
|
6158
6372
|
*/
|
|
@@ -6161,6 +6375,7 @@ export declare const raceAll: <S extends ReadonlyArray<Stream<any, any, any>>>(.
|
|
|
6161
6375
|
* Constructs a stream from a range of integers, including both endpoints.
|
|
6162
6376
|
*
|
|
6163
6377
|
* @example
|
|
6378
|
+
* ```ts
|
|
6164
6379
|
* import { Effect, Stream } from "effect"
|
|
6165
6380
|
*
|
|
6166
6381
|
* // A Stream with a range of numbers from 1 to 5
|
|
@@ -6168,6 +6383,7 @@ export declare const raceAll: <S extends ReadonlyArray<Stream<any, any, any>>>(.
|
|
|
6168
6383
|
*
|
|
6169
6384
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
6170
6385
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
6386
|
+
* ```
|
|
6171
6387
|
*
|
|
6172
6388
|
* @since 2.0.0
|
|
6173
6389
|
* @category constructors
|
|
@@ -6250,12 +6466,14 @@ export declare const refineOrDieWith: {
|
|
|
6250
6466
|
* execute normally, and then repeat again according to the provided schedule.
|
|
6251
6467
|
*
|
|
6252
6468
|
* @example
|
|
6469
|
+
* ```ts
|
|
6253
6470
|
* import { Effect, Schedule, Stream } from "effect"
|
|
6254
6471
|
*
|
|
6255
6472
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6256
6473
|
*
|
|
6257
6474
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6258
6475
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
6476
|
+
* ```
|
|
6259
6477
|
*
|
|
6260
6478
|
* @since 2.0.0
|
|
6261
6479
|
* @category utils
|
|
@@ -6266,12 +6484,14 @@ export declare const repeat: {
|
|
|
6266
6484
|
* execute normally, and then repeat again according to the provided schedule.
|
|
6267
6485
|
*
|
|
6268
6486
|
* @example
|
|
6487
|
+
* ```ts
|
|
6269
6488
|
* import { Effect, Schedule, Stream } from "effect"
|
|
6270
6489
|
*
|
|
6271
6490
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6272
6491
|
*
|
|
6273
6492
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6274
6493
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
6494
|
+
* ```
|
|
6275
6495
|
*
|
|
6276
6496
|
* @since 2.0.0
|
|
6277
6497
|
* @category utils
|
|
@@ -6282,12 +6502,14 @@ export declare const repeat: {
|
|
|
6282
6502
|
* execute normally, and then repeat again according to the provided schedule.
|
|
6283
6503
|
*
|
|
6284
6504
|
* @example
|
|
6505
|
+
* ```ts
|
|
6285
6506
|
* import { Effect, Schedule, Stream } from "effect"
|
|
6286
6507
|
*
|
|
6287
6508
|
* const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
|
|
6288
6509
|
*
|
|
6289
6510
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6290
6511
|
* // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
|
|
6512
|
+
* ```
|
|
6291
6513
|
*
|
|
6292
6514
|
* @since 2.0.0
|
|
6293
6515
|
* @category utils
|
|
@@ -6299,12 +6521,14 @@ export declare const repeat: {
|
|
|
6299
6521
|
* forever.
|
|
6300
6522
|
*
|
|
6301
6523
|
* @example
|
|
6524
|
+
* ```ts
|
|
6302
6525
|
* import { Effect, Random, Stream } from "effect"
|
|
6303
6526
|
*
|
|
6304
6527
|
* const stream = Stream.repeatEffect(Random.nextInt)
|
|
6305
6528
|
*
|
|
6306
6529
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6307
6530
|
* // Example Output: { _id: 'Chunk', values: [ 3891571149, 4239494205, 2352981603, 2339111046, 1488052210 ] }
|
|
6531
|
+
* ```
|
|
6308
6532
|
*
|
|
6309
6533
|
* @since 2.0.0
|
|
6310
6534
|
* @category constructors
|
|
@@ -6331,6 +6555,7 @@ export declare const repeatEffectChunkOption: <A, E, R>(effect: Effect.Effect<Ch
|
|
|
6331
6555
|
* with `None`.
|
|
6332
6556
|
*
|
|
6333
6557
|
* @example
|
|
6558
|
+
* ```ts
|
|
6334
6559
|
* // In this example, we're draining an Iterator to create a stream from it
|
|
6335
6560
|
* import { Stream, Effect, Option } from "effect"
|
|
6336
6561
|
*
|
|
@@ -6345,6 +6570,7 @@ export declare const repeatEffectChunkOption: <A, E, R>(effect: Effect.Effect<Ch
|
|
|
6345
6570
|
* })
|
|
6346
6571
|
* )
|
|
6347
6572
|
* )
|
|
6573
|
+
* ```
|
|
6348
6574
|
*
|
|
6349
6575
|
* @since 2.0.0
|
|
6350
6576
|
* @category constructors
|
|
@@ -6479,12 +6705,14 @@ export declare const repeatElementsWith: {
|
|
|
6479
6705
|
* Repeats the provided value infinitely.
|
|
6480
6706
|
*
|
|
6481
6707
|
* @example
|
|
6708
|
+
* ```ts
|
|
6482
6709
|
* import { Effect, Stream } from "effect"
|
|
6483
6710
|
*
|
|
6484
6711
|
* const stream = Stream.repeatValue(0)
|
|
6485
6712
|
*
|
|
6486
6713
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
6487
6714
|
* // { _id: 'Chunk', values: [ 0, 0, 0, 0, 0 ] }
|
|
6715
|
+
* ```
|
|
6488
6716
|
*
|
|
6489
6717
|
* @since 2.0.0
|
|
6490
6718
|
* @category constructors
|
|
@@ -6598,21 +6826,21 @@ export declare const run: {
|
|
|
6598
6826
|
* @since 2.0.0
|
|
6599
6827
|
* @category destructors
|
|
6600
6828
|
*/
|
|
6601
|
-
export declare const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk.Chunk<A>, E,
|
|
6829
|
+
export declare const runCollect: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Chunk.Chunk<A>, E, R>;
|
|
6602
6830
|
/**
|
|
6603
6831
|
* Runs the stream and emits the number of elements processed
|
|
6604
6832
|
*
|
|
6605
6833
|
* @since 2.0.0
|
|
6606
6834
|
* @category destructors
|
|
6607
6835
|
*/
|
|
6608
|
-
export declare const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number, E,
|
|
6836
|
+
export declare const runCount: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<number, E, R>;
|
|
6609
6837
|
/**
|
|
6610
6838
|
* Runs the stream only for its effects. The emitted elements are discarded.
|
|
6611
6839
|
*
|
|
6612
6840
|
* @since 2.0.0
|
|
6613
6841
|
* @category destructors
|
|
6614
6842
|
*/
|
|
6615
|
-
export declare const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E,
|
|
6843
|
+
export declare const runDrain: <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<void, E, R>;
|
|
6616
6844
|
/**
|
|
6617
6845
|
* Executes a pure fold over the stream of values - reduces all elements in
|
|
6618
6846
|
* the stream to a value of type `S`.
|
|
@@ -6628,7 +6856,7 @@ export declare const runFold: {
|
|
|
6628
6856
|
* @since 2.0.0
|
|
6629
6857
|
* @category destructors
|
|
6630
6858
|
*/
|
|
6631
|
-
<S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E,
|
|
6859
|
+
<S, A>(s: S, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E, R>;
|
|
6632
6860
|
/**
|
|
6633
6861
|
* Executes a pure fold over the stream of values - reduces all elements in
|
|
6634
6862
|
* the stream to a value of type `S`.
|
|
@@ -6636,7 +6864,7 @@ export declare const runFold: {
|
|
|
6636
6864
|
* @since 2.0.0
|
|
6637
6865
|
* @category destructors
|
|
6638
6866
|
*/
|
|
6639
|
-
<A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E,
|
|
6867
|
+
<A, E, R, S>(self: Stream<A, E, R>, s: S, f: (s: S, a: A) => S): Effect.Effect<S, E, R>;
|
|
6640
6868
|
};
|
|
6641
6869
|
/**
|
|
6642
6870
|
* Executes an effectful fold over the stream of values.
|
|
@@ -6725,7 +6953,7 @@ export declare const runFoldWhile: {
|
|
|
6725
6953
|
* @since 2.0.0
|
|
6726
6954
|
* @category destructors
|
|
6727
6955
|
*/
|
|
6728
|
-
<S, A>(s: S, cont: Predicate<S>, f: (s: S, a: A) => S): <E, R>(self: Stream<A, E, R>) => Effect.Effect<S, E,
|
|
6956
|
+
<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>;
|
|
6729
6957
|
/**
|
|
6730
6958
|
* Reduces the elements in the stream to a value of type `S`. Stops the fold
|
|
6731
6959
|
* early when the condition is not fulfilled. Example:
|
|
@@ -6733,7 +6961,7 @@ export declare const runFoldWhile: {
|
|
|
6733
6961
|
* @since 2.0.0
|
|
6734
6962
|
* @category destructors
|
|
6735
6963
|
*/
|
|
6736
|
-
<A, E, R, S>(self: Stream<A, E, R>, s: S, cont: Predicate<S>, f: (s: S, a: A) => S): Effect.Effect<S, E,
|
|
6964
|
+
<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>;
|
|
6737
6965
|
};
|
|
6738
6966
|
/**
|
|
6739
6967
|
* Executes an effectful fold over the stream of values. Stops the fold early
|
|
@@ -7135,12 +7363,14 @@ export declare const runSum: <E, R>(self: Stream<number, E, R>) => Effect.Effect
|
|
|
7135
7363
|
* intermediate results of type `S` given an initial S.
|
|
7136
7364
|
*
|
|
7137
7365
|
* @example
|
|
7366
|
+
* ```ts
|
|
7138
7367
|
* import { Effect, Stream } from "effect"
|
|
7139
7368
|
*
|
|
7140
7369
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7141
7370
|
*
|
|
7142
7371
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7143
7372
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
7373
|
+
* ```
|
|
7144
7374
|
*
|
|
7145
7375
|
* @since 2.0.0
|
|
7146
7376
|
* @category utils
|
|
@@ -7151,12 +7381,14 @@ export declare const scan: {
|
|
|
7151
7381
|
* intermediate results of type `S` given an initial S.
|
|
7152
7382
|
*
|
|
7153
7383
|
* @example
|
|
7384
|
+
* ```ts
|
|
7154
7385
|
* import { Effect, Stream } from "effect"
|
|
7155
7386
|
*
|
|
7156
7387
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7157
7388
|
*
|
|
7158
7389
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7159
7390
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
7391
|
+
* ```
|
|
7160
7392
|
*
|
|
7161
7393
|
* @since 2.0.0
|
|
7162
7394
|
* @category utils
|
|
@@ -7167,12 +7399,14 @@ export declare const scan: {
|
|
|
7167
7399
|
* intermediate results of type `S` given an initial S.
|
|
7168
7400
|
*
|
|
7169
7401
|
* @example
|
|
7402
|
+
* ```ts
|
|
7170
7403
|
* import { Effect, Stream } from "effect"
|
|
7171
7404
|
*
|
|
7172
7405
|
* const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
|
|
7173
7406
|
*
|
|
7174
7407
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7175
7408
|
* // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
|
|
7409
|
+
* ```
|
|
7176
7410
|
*
|
|
7177
7411
|
* @since 2.0.0
|
|
7178
7412
|
* @category utils
|
|
@@ -7326,6 +7560,7 @@ export declare const scheduleWith: {
|
|
|
7326
7560
|
* Creates a single-valued stream from a scoped resource.
|
|
7327
7561
|
*
|
|
7328
7562
|
* @example
|
|
7563
|
+
* ```ts
|
|
7329
7564
|
* import { Console, Effect, Stream } from "effect"
|
|
7330
7565
|
*
|
|
7331
7566
|
* // Creating a single-valued stream from a scoped resource
|
|
@@ -7342,11 +7577,21 @@ export declare const scheduleWith: {
|
|
|
7342
7577
|
* // use
|
|
7343
7578
|
* // release
|
|
7344
7579
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
7580
|
+
* ```
|
|
7345
7581
|
*
|
|
7346
7582
|
* @since 2.0.0
|
|
7347
7583
|
* @category constructors
|
|
7348
7584
|
*/
|
|
7349
7585
|
export declare const scoped: <A, E, R>(effect: Effect.Effect<A, E, R>) => Stream<A, E, Exclude<R, Scope.Scope>>;
|
|
7586
|
+
/**
|
|
7587
|
+
* Use a function that receives a scope and returns an effect to emit an output
|
|
7588
|
+
* element. The output element will be the result of the returned effect, if
|
|
7589
|
+
* successful.
|
|
7590
|
+
*
|
|
7591
|
+
* @since 3.11.0
|
|
7592
|
+
* @category constructors
|
|
7593
|
+
*/
|
|
7594
|
+
export declare const scopedWith: <A, E, R>(f: (scope: Scope.Scope) => Effect.Effect<A, E, R>) => Stream<A, E, R>;
|
|
7350
7595
|
/**
|
|
7351
7596
|
* Emits a sliding window of `n` elements.
|
|
7352
7597
|
*
|
|
@@ -7608,6 +7853,7 @@ export declare const splitLines: <E, R>(self: Stream<string, E, R>) => Stream<st
|
|
|
7608
7853
|
* Creates a single-valued pure stream.
|
|
7609
7854
|
*
|
|
7610
7855
|
* @example
|
|
7856
|
+
* ```ts
|
|
7611
7857
|
* import { Effect, Stream } from "effect"
|
|
7612
7858
|
*
|
|
7613
7859
|
* // A Stream with a single number
|
|
@@ -7615,6 +7861,7 @@ export declare const splitLines: <E, R>(self: Stream<string, E, R>) => Stream<st
|
|
|
7615
7861
|
*
|
|
7616
7862
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7617
7863
|
* // { _id: 'Chunk', values: [ 3 ] }
|
|
7864
|
+
* ```
|
|
7618
7865
|
*
|
|
7619
7866
|
* @since 2.0.0
|
|
7620
7867
|
* @category constructors
|
|
@@ -7638,12 +7885,14 @@ export declare const suspend: <A, E, R>(stream: LazyArg<Stream<A, E, R>>) => Str
|
|
|
7638
7885
|
* Takes the specified number of elements from this stream.
|
|
7639
7886
|
*
|
|
7640
7887
|
* @example
|
|
7888
|
+
* ```ts
|
|
7641
7889
|
* import { Effect, Stream } from "effect"
|
|
7642
7890
|
*
|
|
7643
7891
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
7644
7892
|
*
|
|
7645
7893
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7646
7894
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
7895
|
+
* ```
|
|
7647
7896
|
*
|
|
7648
7897
|
* @since 2.0.0
|
|
7649
7898
|
* @category utils
|
|
@@ -7653,12 +7902,14 @@ export declare const take: {
|
|
|
7653
7902
|
* Takes the specified number of elements from this stream.
|
|
7654
7903
|
*
|
|
7655
7904
|
* @example
|
|
7905
|
+
* ```ts
|
|
7656
7906
|
* import { Effect, Stream } from "effect"
|
|
7657
7907
|
*
|
|
7658
7908
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
7659
7909
|
*
|
|
7660
7910
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7661
7911
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
7912
|
+
* ```
|
|
7662
7913
|
*
|
|
7663
7914
|
* @since 2.0.0
|
|
7664
7915
|
* @category utils
|
|
@@ -7668,12 +7919,14 @@ export declare const take: {
|
|
|
7668
7919
|
* Takes the specified number of elements from this stream.
|
|
7669
7920
|
*
|
|
7670
7921
|
* @example
|
|
7922
|
+
* ```ts
|
|
7671
7923
|
* import { Effect, Stream } from "effect"
|
|
7672
7924
|
*
|
|
7673
7925
|
* const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
|
|
7674
7926
|
*
|
|
7675
7927
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7676
7928
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
7929
|
+
* ```
|
|
7677
7930
|
*
|
|
7678
7931
|
* @since 2.0.0
|
|
7679
7932
|
* @category utils
|
|
@@ -7684,12 +7937,14 @@ export declare const take: {
|
|
|
7684
7937
|
* Takes the last specified number of elements from this stream.
|
|
7685
7938
|
*
|
|
7686
7939
|
* @example
|
|
7940
|
+
* ```ts
|
|
7687
7941
|
* import { Effect, Stream } from "effect"
|
|
7688
7942
|
*
|
|
7689
7943
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
7690
7944
|
*
|
|
7691
7945
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7692
7946
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
7947
|
+
* ```
|
|
7693
7948
|
*
|
|
7694
7949
|
* @since 2.0.0
|
|
7695
7950
|
* @category utils
|
|
@@ -7699,12 +7954,14 @@ export declare const takeRight: {
|
|
|
7699
7954
|
* Takes the last specified number of elements from this stream.
|
|
7700
7955
|
*
|
|
7701
7956
|
* @example
|
|
7957
|
+
* ```ts
|
|
7702
7958
|
* import { Effect, Stream } from "effect"
|
|
7703
7959
|
*
|
|
7704
7960
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
7705
7961
|
*
|
|
7706
7962
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7707
7963
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
7964
|
+
* ```
|
|
7708
7965
|
*
|
|
7709
7966
|
* @since 2.0.0
|
|
7710
7967
|
* @category utils
|
|
@@ -7714,12 +7971,14 @@ export declare const takeRight: {
|
|
|
7714
7971
|
* Takes the last specified number of elements from this stream.
|
|
7715
7972
|
*
|
|
7716
7973
|
* @example
|
|
7974
|
+
* ```ts
|
|
7717
7975
|
* import { Effect, Stream } from "effect"
|
|
7718
7976
|
*
|
|
7719
7977
|
* const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
|
|
7720
7978
|
*
|
|
7721
7979
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7722
7980
|
* // { _id: 'Chunk', values: [ 4, 5, 6 ] }
|
|
7981
|
+
* ```
|
|
7723
7982
|
*
|
|
7724
7983
|
* @since 2.0.0
|
|
7725
7984
|
* @category utils
|
|
@@ -7731,12 +7990,14 @@ export declare const takeRight: {
|
|
|
7731
7990
|
* `true`.
|
|
7732
7991
|
*
|
|
7733
7992
|
* @example
|
|
7993
|
+
* ```ts
|
|
7734
7994
|
* import { Effect, Stream } from "effect"
|
|
7735
7995
|
*
|
|
7736
7996
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
7737
7997
|
*
|
|
7738
7998
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7739
7999
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8000
|
+
* ```
|
|
7740
8001
|
*
|
|
7741
8002
|
* @since 2.0.0
|
|
7742
8003
|
* @category utils
|
|
@@ -7747,12 +8008,14 @@ export declare const takeUntil: {
|
|
|
7747
8008
|
* `true`.
|
|
7748
8009
|
*
|
|
7749
8010
|
* @example
|
|
8011
|
+
* ```ts
|
|
7750
8012
|
* import { Effect, Stream } from "effect"
|
|
7751
8013
|
*
|
|
7752
8014
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
7753
8015
|
*
|
|
7754
8016
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7755
8017
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8018
|
+
* ```
|
|
7756
8019
|
*
|
|
7757
8020
|
* @since 2.0.0
|
|
7758
8021
|
* @category utils
|
|
@@ -7763,12 +8026,14 @@ export declare const takeUntil: {
|
|
|
7763
8026
|
* `true`.
|
|
7764
8027
|
*
|
|
7765
8028
|
* @example
|
|
8029
|
+
* ```ts
|
|
7766
8030
|
* import { Effect, Stream } from "effect"
|
|
7767
8031
|
*
|
|
7768
8032
|
* const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
|
|
7769
8033
|
*
|
|
7770
8034
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7771
8035
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8036
|
+
* ```
|
|
7772
8037
|
*
|
|
7773
8038
|
* @since 2.0.0
|
|
7774
8039
|
* @category utils
|
|
@@ -7805,12 +8070,14 @@ export declare const takeUntilEffect: {
|
|
|
7805
8070
|
* evaluates to `true`.
|
|
7806
8071
|
*
|
|
7807
8072
|
* @example
|
|
8073
|
+
* ```ts
|
|
7808
8074
|
* import { Effect, Stream } from "effect"
|
|
7809
8075
|
*
|
|
7810
8076
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
7811
8077
|
*
|
|
7812
8078
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7813
8079
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8080
|
+
* ```
|
|
7814
8081
|
*
|
|
7815
8082
|
* @since 2.0.0
|
|
7816
8083
|
* @category utils
|
|
@@ -7821,12 +8088,14 @@ export declare const takeWhile: {
|
|
|
7821
8088
|
* evaluates to `true`.
|
|
7822
8089
|
*
|
|
7823
8090
|
* @example
|
|
8091
|
+
* ```ts
|
|
7824
8092
|
* import { Effect, Stream } from "effect"
|
|
7825
8093
|
*
|
|
7826
8094
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
7827
8095
|
*
|
|
7828
8096
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7829
8097
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8098
|
+
* ```
|
|
7830
8099
|
*
|
|
7831
8100
|
* @since 2.0.0
|
|
7832
8101
|
* @category utils
|
|
@@ -7837,12 +8106,14 @@ export declare const takeWhile: {
|
|
|
7837
8106
|
* evaluates to `true`.
|
|
7838
8107
|
*
|
|
7839
8108
|
* @example
|
|
8109
|
+
* ```ts
|
|
7840
8110
|
* import { Effect, Stream } from "effect"
|
|
7841
8111
|
*
|
|
7842
8112
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
7843
8113
|
*
|
|
7844
8114
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7845
8115
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8116
|
+
* ```
|
|
7846
8117
|
*
|
|
7847
8118
|
* @since 2.0.0
|
|
7848
8119
|
* @category utils
|
|
@@ -7853,12 +8124,14 @@ export declare const takeWhile: {
|
|
|
7853
8124
|
* evaluates to `true`.
|
|
7854
8125
|
*
|
|
7855
8126
|
* @example
|
|
8127
|
+
* ```ts
|
|
7856
8128
|
* import { Effect, Stream } from "effect"
|
|
7857
8129
|
*
|
|
7858
8130
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
7859
8131
|
*
|
|
7860
8132
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7861
8133
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8134
|
+
* ```
|
|
7862
8135
|
*
|
|
7863
8136
|
* @since 2.0.0
|
|
7864
8137
|
* @category utils
|
|
@@ -7869,12 +8142,14 @@ export declare const takeWhile: {
|
|
|
7869
8142
|
* evaluates to `true`.
|
|
7870
8143
|
*
|
|
7871
8144
|
* @example
|
|
8145
|
+
* ```ts
|
|
7872
8146
|
* import { Effect, Stream } from "effect"
|
|
7873
8147
|
*
|
|
7874
8148
|
* const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
|
|
7875
8149
|
*
|
|
7876
8150
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
7877
8151
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
|
|
8152
|
+
* ```
|
|
7878
8153
|
*
|
|
7879
8154
|
* @since 2.0.0
|
|
7880
8155
|
* @category utils
|
|
@@ -7885,6 +8160,7 @@ export declare const takeWhile: {
|
|
|
7885
8160
|
* Adds an effect to consumption of every element of the stream.
|
|
7886
8161
|
*
|
|
7887
8162
|
* @example
|
|
8163
|
+
* ```ts
|
|
7888
8164
|
* import { Console, Effect, Stream } from "effect"
|
|
7889
8165
|
*
|
|
7890
8166
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -7901,6 +8177,7 @@ export declare const takeWhile: {
|
|
|
7901
8177
|
* // before mapping: 3
|
|
7902
8178
|
* // after mapping: 6
|
|
7903
8179
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
8180
|
+
* ```
|
|
7904
8181
|
*
|
|
7905
8182
|
* @since 2.0.0
|
|
7906
8183
|
* @category sequencing
|
|
@@ -7910,6 +8187,7 @@ export declare const tap: {
|
|
|
7910
8187
|
* Adds an effect to consumption of every element of the stream.
|
|
7911
8188
|
*
|
|
7912
8189
|
* @example
|
|
8190
|
+
* ```ts
|
|
7913
8191
|
* import { Console, Effect, Stream } from "effect"
|
|
7914
8192
|
*
|
|
7915
8193
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -7926,6 +8204,7 @@ export declare const tap: {
|
|
|
7926
8204
|
* // before mapping: 3
|
|
7927
8205
|
* // after mapping: 6
|
|
7928
8206
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
8207
|
+
* ```
|
|
7929
8208
|
*
|
|
7930
8209
|
* @since 2.0.0
|
|
7931
8210
|
* @category sequencing
|
|
@@ -7935,6 +8214,7 @@ export declare const tap: {
|
|
|
7935
8214
|
* Adds an effect to consumption of every element of the stream.
|
|
7936
8215
|
*
|
|
7937
8216
|
* @example
|
|
8217
|
+
* ```ts
|
|
7938
8218
|
* import { Console, Effect, Stream } from "effect"
|
|
7939
8219
|
*
|
|
7940
8220
|
* const stream = Stream.make(1, 2, 3).pipe(
|
|
@@ -7951,6 +8231,7 @@ export declare const tap: {
|
|
|
7951
8231
|
* // before mapping: 3
|
|
7952
8232
|
* // after mapping: 6
|
|
7953
8233
|
* // { _id: 'Chunk', values: [ 2, 4, 6 ] }
|
|
8234
|
+
* ```
|
|
7954
8235
|
*
|
|
7955
8236
|
* @since 2.0.0
|
|
7956
8237
|
* @category sequencing
|
|
@@ -8074,6 +8355,7 @@ export declare const tapSink: {
|
|
|
8074
8355
|
* Defaults to the "shape" strategy.
|
|
8075
8356
|
*
|
|
8076
8357
|
* @example
|
|
8358
|
+
* ```ts
|
|
8077
8359
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
8078
8360
|
*
|
|
8079
8361
|
* let last = Date.now()
|
|
@@ -8109,6 +8391,7 @@ export declare const tapSink: {
|
|
|
8109
8391
|
* // Received 5 after 52ms
|
|
8110
8392
|
* // > Emitted 5 after 49ms
|
|
8111
8393
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
|
|
8394
|
+
* ```
|
|
8112
8395
|
*
|
|
8113
8396
|
* @since 2.0.0
|
|
8114
8397
|
* @category utils
|
|
@@ -8128,6 +8411,7 @@ export declare const throttle: {
|
|
|
8128
8411
|
* Defaults to the "shape" strategy.
|
|
8129
8412
|
*
|
|
8130
8413
|
* @example
|
|
8414
|
+
* ```ts
|
|
8131
8415
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
8132
8416
|
*
|
|
8133
8417
|
* let last = Date.now()
|
|
@@ -8163,6 +8447,7 @@ export declare const throttle: {
|
|
|
8163
8447
|
* // Received 5 after 52ms
|
|
8164
8448
|
* // > Emitted 5 after 49ms
|
|
8165
8449
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
|
|
8450
|
+
* ```
|
|
8166
8451
|
*
|
|
8167
8452
|
* @since 2.0.0
|
|
8168
8453
|
* @category utils
|
|
@@ -8188,6 +8473,7 @@ export declare const throttle: {
|
|
|
8188
8473
|
* Defaults to the "shape" strategy.
|
|
8189
8474
|
*
|
|
8190
8475
|
* @example
|
|
8476
|
+
* ```ts
|
|
8191
8477
|
* import { Chunk, Effect, Schedule, Stream } from "effect"
|
|
8192
8478
|
*
|
|
8193
8479
|
* let last = Date.now()
|
|
@@ -8223,6 +8509,7 @@ export declare const throttle: {
|
|
|
8223
8509
|
* // Received 5 after 52ms
|
|
8224
8510
|
* // > Emitted 5 after 49ms
|
|
8225
8511
|
* // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
|
|
8512
|
+
* ```
|
|
8226
8513
|
*
|
|
8227
8514
|
* @since 2.0.0
|
|
8228
8515
|
* @category utils
|
|
@@ -8303,6 +8590,7 @@ export declare const throttleEffect: {
|
|
|
8303
8590
|
* A stream that emits void values spaced by the specified duration.
|
|
8304
8591
|
*
|
|
8305
8592
|
* @example
|
|
8593
|
+
* ```ts
|
|
8306
8594
|
* import { Effect, Stream } from "effect"
|
|
8307
8595
|
*
|
|
8308
8596
|
* let last = Date.now()
|
|
@@ -8322,6 +8610,7 @@ export declare const throttleEffect: {
|
|
|
8322
8610
|
* // tick after 1002ms
|
|
8323
8611
|
* // tick after 1002ms
|
|
8324
8612
|
* // { _id: 'Chunk', values: [ undefined, undefined, undefined, undefined, undefined ] }
|
|
8613
|
+
* ```
|
|
8325
8614
|
*
|
|
8326
8615
|
* @since 2.0.0
|
|
8327
8616
|
* @category constructors
|
|
@@ -8470,6 +8759,7 @@ export declare const toPubSub: {
|
|
|
8470
8759
|
* the stream's output.
|
|
8471
8760
|
*
|
|
8472
8761
|
* @example
|
|
8762
|
+
* ```ts
|
|
8473
8763
|
* import { Effect, Stream } from "effect"
|
|
8474
8764
|
*
|
|
8475
8765
|
* // Simulate a chunked stream
|
|
@@ -8494,6 +8784,7 @@ export declare const toPubSub: {
|
|
|
8494
8784
|
* // "_id": "Option",
|
|
8495
8785
|
* // "_tag": "None"
|
|
8496
8786
|
* // }
|
|
8787
|
+
* ```
|
|
8497
8788
|
*
|
|
8498
8789
|
* @since 2.0.0
|
|
8499
8790
|
* @category destructors
|
|
@@ -8697,12 +8988,14 @@ export declare const transduce: {
|
|
|
8697
8988
|
* Creates a stream by peeling off the "layers" of a value of type `S`.
|
|
8698
8989
|
*
|
|
8699
8990
|
* @example
|
|
8991
|
+
* ```ts
|
|
8700
8992
|
* import { Effect, Option, Stream } from "effect"
|
|
8701
8993
|
*
|
|
8702
8994
|
* const stream = Stream.unfold(1, (n) => Option.some([n, n + 1]))
|
|
8703
8995
|
*
|
|
8704
8996
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
8705
8997
|
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
8998
|
+
* ```
|
|
8706
8999
|
*
|
|
8707
9000
|
* @since 2.0.0
|
|
8708
9001
|
* @category constructors
|
|
@@ -8728,6 +9021,7 @@ export declare const unfoldChunkEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.E
|
|
|
8728
9021
|
* `S`.
|
|
8729
9022
|
*
|
|
8730
9023
|
* @example
|
|
9024
|
+
* ```ts
|
|
8731
9025
|
* import { Effect, Option, Random, Stream } from "effect"
|
|
8732
9026
|
*
|
|
8733
9027
|
* const stream = Stream.unfoldEffect(1, (n) =>
|
|
@@ -8737,6 +9031,7 @@ export declare const unfoldChunkEffect: <S, A, E, R>(s: S, f: (s: S) => Effect.E
|
|
|
8737
9031
|
*
|
|
8738
9032
|
* // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
|
|
8739
9033
|
* // { _id: 'Chunk', values: [ 1, -1, -1, -1, -1 ] }
|
|
9034
|
+
* ```
|
|
8740
9035
|
*
|
|
8741
9036
|
* @since 2.0.0
|
|
8742
9037
|
* @category constructors
|
|
@@ -8748,6 +9043,7 @@ export {
|
|
|
8748
9043
|
* A stream that contains a single `void` value.
|
|
8749
9044
|
*
|
|
8750
9045
|
* @example
|
|
9046
|
+
* ```ts
|
|
8751
9047
|
* import { Effect, Stream } from "effect"
|
|
8752
9048
|
*
|
|
8753
9049
|
* const stream = Stream.void
|
|
@@ -8755,6 +9051,7 @@ export {
|
|
|
8755
9051
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8756
9052
|
* // { _id: 'Chunk', values: [ undefined ] }
|
|
8757
9053
|
*
|
|
9054
|
+
* ```
|
|
8758
9055
|
* @since 2.0.0
|
|
8759
9056
|
* @category constructors
|
|
8760
9057
|
*/
|
|
@@ -8773,6 +9070,15 @@ export declare const unwrap: <A, E2, R2, E, R>(effect: Effect.Effect<Stream<A, E
|
|
|
8773
9070
|
* @category constructors
|
|
8774
9071
|
*/
|
|
8775
9072
|
export declare const unwrapScoped: <A, E2, R2, E, R>(effect: Effect.Effect<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R2 | Exclude<R, Scope.Scope>>;
|
|
9073
|
+
/**
|
|
9074
|
+
* Creates a stream produced from a function which receives a `Scope` and
|
|
9075
|
+
* returns an `Effect`. The resulting stream will emit a single element, which
|
|
9076
|
+
* will be the result of the returned effect, if successful.
|
|
9077
|
+
*
|
|
9078
|
+
* @since 3.11.0
|
|
9079
|
+
* @category constructors
|
|
9080
|
+
*/
|
|
9081
|
+
export declare const unwrapScopedWith: <A, E2, R2, E, R>(f: (scope: Scope.Scope) => Effect.Effect<Stream<A, E2, R2>, E, R>) => Stream<A, E | E2, R | R2>;
|
|
8776
9082
|
/**
|
|
8777
9083
|
* Updates the specified service within the context of the `Stream`.
|
|
8778
9084
|
*
|
|
@@ -8907,6 +9213,7 @@ export declare const withSpan: {
|
|
|
8907
9213
|
* The new stream will end when one of the sides ends.
|
|
8908
9214
|
*
|
|
8909
9215
|
* @example
|
|
9216
|
+
* ```ts
|
|
8910
9217
|
* import { Effect, Stream } from "effect"
|
|
8911
9218
|
*
|
|
8912
9219
|
* // We create two streams and zip them together.
|
|
@@ -8917,6 +9224,7 @@ export declare const withSpan: {
|
|
|
8917
9224
|
*
|
|
8918
9225
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8919
9226
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
9227
|
+
* ```
|
|
8920
9228
|
*
|
|
8921
9229
|
* @since 2.0.0
|
|
8922
9230
|
* @category zipping
|
|
@@ -8929,6 +9237,7 @@ export declare const zip: {
|
|
|
8929
9237
|
* The new stream will end when one of the sides ends.
|
|
8930
9238
|
*
|
|
8931
9239
|
* @example
|
|
9240
|
+
* ```ts
|
|
8932
9241
|
* import { Effect, Stream } from "effect"
|
|
8933
9242
|
*
|
|
8934
9243
|
* // We create two streams and zip them together.
|
|
@@ -8939,6 +9248,7 @@ export declare const zip: {
|
|
|
8939
9248
|
*
|
|
8940
9249
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8941
9250
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
9251
|
+
* ```
|
|
8942
9252
|
*
|
|
8943
9253
|
* @since 2.0.0
|
|
8944
9254
|
* @category zipping
|
|
@@ -8951,6 +9261,7 @@ export declare const zip: {
|
|
|
8951
9261
|
* The new stream will end when one of the sides ends.
|
|
8952
9262
|
*
|
|
8953
9263
|
* @example
|
|
9264
|
+
* ```ts
|
|
8954
9265
|
* import { Effect, Stream } from "effect"
|
|
8955
9266
|
*
|
|
8956
9267
|
* // We create two streams and zip them together.
|
|
@@ -8961,6 +9272,7 @@ export declare const zip: {
|
|
|
8961
9272
|
*
|
|
8962
9273
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
8963
9274
|
* // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
|
|
9275
|
+
* ```
|
|
8964
9276
|
*
|
|
8965
9277
|
* @since 2.0.0
|
|
8966
9278
|
* @category zipping
|
|
@@ -9006,6 +9318,7 @@ export declare const zipFlatten: {
|
|
|
9006
9318
|
* have different lengths and one of the streams has ended before the other.
|
|
9007
9319
|
*
|
|
9008
9320
|
* @example
|
|
9321
|
+
* ```ts
|
|
9009
9322
|
* import { Effect, Stream } from "effect"
|
|
9010
9323
|
*
|
|
9011
9324
|
* const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9016,6 +9329,7 @@ export declare const zipFlatten: {
|
|
|
9016
9329
|
*
|
|
9017
9330
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9018
9331
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9332
|
+
* ```
|
|
9019
9333
|
*
|
|
9020
9334
|
* @since 2.0.0
|
|
9021
9335
|
* @category zipping
|
|
@@ -9029,6 +9343,7 @@ export declare const zipAll: {
|
|
|
9029
9343
|
* have different lengths and one of the streams has ended before the other.
|
|
9030
9344
|
*
|
|
9031
9345
|
* @example
|
|
9346
|
+
* ```ts
|
|
9032
9347
|
* import { Effect, Stream } from "effect"
|
|
9033
9348
|
*
|
|
9034
9349
|
* const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9039,6 +9354,7 @@ export declare const zipAll: {
|
|
|
9039
9354
|
*
|
|
9040
9355
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9041
9356
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9357
|
+
* ```
|
|
9042
9358
|
*
|
|
9043
9359
|
* @since 2.0.0
|
|
9044
9360
|
* @category zipping
|
|
@@ -9056,6 +9372,7 @@ export declare const zipAll: {
|
|
|
9056
9372
|
* have different lengths and one of the streams has ended before the other.
|
|
9057
9373
|
*
|
|
9058
9374
|
* @example
|
|
9375
|
+
* ```ts
|
|
9059
9376
|
* import { Effect, Stream } from "effect"
|
|
9060
9377
|
*
|
|
9061
9378
|
* const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9066,6 +9383,7 @@ export declare const zipAll: {
|
|
|
9066
9383
|
*
|
|
9067
9384
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9068
9385
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9386
|
+
* ```
|
|
9069
9387
|
*
|
|
9070
9388
|
* @since 2.0.0
|
|
9071
9389
|
* @category zipping
|
|
@@ -9368,6 +9686,7 @@ export declare const zipAllSortedByKeyWith: {
|
|
|
9368
9686
|
* lengths and one of the streams has ended before the other.
|
|
9369
9687
|
*
|
|
9370
9688
|
* @example
|
|
9689
|
+
* ```ts
|
|
9371
9690
|
* import { Effect, Stream } from "effect"
|
|
9372
9691
|
*
|
|
9373
9692
|
* const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9379,6 +9698,7 @@ export declare const zipAllSortedByKeyWith: {
|
|
|
9379
9698
|
*
|
|
9380
9699
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9381
9700
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9701
|
+
* ```
|
|
9382
9702
|
*
|
|
9383
9703
|
* @since 2.0.0
|
|
9384
9704
|
* @category zipping
|
|
@@ -9392,6 +9712,7 @@ export declare const zipAllWith: {
|
|
|
9392
9712
|
* lengths and one of the streams has ended before the other.
|
|
9393
9713
|
*
|
|
9394
9714
|
* @example
|
|
9715
|
+
* ```ts
|
|
9395
9716
|
* import { Effect, Stream } from "effect"
|
|
9396
9717
|
*
|
|
9397
9718
|
* const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9403,6 +9724,7 @@ export declare const zipAllWith: {
|
|
|
9403
9724
|
*
|
|
9404
9725
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9405
9726
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9727
|
+
* ```
|
|
9406
9728
|
*
|
|
9407
9729
|
* @since 2.0.0
|
|
9408
9730
|
* @category zipping
|
|
@@ -9421,6 +9743,7 @@ export declare const zipAllWith: {
|
|
|
9421
9743
|
* lengths and one of the streams has ended before the other.
|
|
9422
9744
|
*
|
|
9423
9745
|
* @example
|
|
9746
|
+
* ```ts
|
|
9424
9747
|
* import { Effect, Stream } from "effect"
|
|
9425
9748
|
*
|
|
9426
9749
|
* const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
|
|
@@ -9432,6 +9755,7 @@ export declare const zipAllWith: {
|
|
|
9432
9755
|
*
|
|
9433
9756
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9434
9757
|
* // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
|
|
9758
|
+
* ```
|
|
9435
9759
|
*
|
|
9436
9760
|
* @since 2.0.0
|
|
9437
9761
|
* @category zipping
|
|
@@ -9453,6 +9777,7 @@ export declare const zipAllWith: {
|
|
|
9453
9777
|
* used for zipping.
|
|
9454
9778
|
*
|
|
9455
9779
|
* @example
|
|
9780
|
+
* ```ts
|
|
9456
9781
|
* import { Effect, Schedule, Stream } from "effect"
|
|
9457
9782
|
*
|
|
9458
9783
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -9467,6 +9792,7 @@ export declare const zipAllWith: {
|
|
|
9467
9792
|
*
|
|
9468
9793
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9469
9794
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
9795
|
+
* ```
|
|
9470
9796
|
*
|
|
9471
9797
|
* @since 2.0.0
|
|
9472
9798
|
* @category zipping
|
|
@@ -9482,6 +9808,7 @@ export declare const zipLatest: {
|
|
|
9482
9808
|
* used for zipping.
|
|
9483
9809
|
*
|
|
9484
9810
|
* @example
|
|
9811
|
+
* ```ts
|
|
9485
9812
|
* import { Effect, Schedule, Stream } from "effect"
|
|
9486
9813
|
*
|
|
9487
9814
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -9496,6 +9823,7 @@ export declare const zipLatest: {
|
|
|
9496
9823
|
*
|
|
9497
9824
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9498
9825
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
9826
|
+
* ```
|
|
9499
9827
|
*
|
|
9500
9828
|
* @since 2.0.0
|
|
9501
9829
|
* @category zipping
|
|
@@ -9511,6 +9839,7 @@ export declare const zipLatest: {
|
|
|
9511
9839
|
* used for zipping.
|
|
9512
9840
|
*
|
|
9513
9841
|
* @example
|
|
9842
|
+
* ```ts
|
|
9514
9843
|
* import { Effect, Schedule, Stream } from "effect"
|
|
9515
9844
|
*
|
|
9516
9845
|
* const s1 = Stream.make(1, 2, 3).pipe(
|
|
@@ -9525,6 +9854,7 @@ export declare const zipLatest: {
|
|
|
9525
9854
|
*
|
|
9526
9855
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9527
9856
|
* // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
|
|
9857
|
+
* ```
|
|
9528
9858
|
*
|
|
9529
9859
|
* @since 2.0.0
|
|
9530
9860
|
* @category zipping
|
|
@@ -9540,6 +9870,7 @@ export declare const zipLatest: {
|
|
|
9540
9870
|
* used for zipping.
|
|
9541
9871
|
*
|
|
9542
9872
|
* @example
|
|
9873
|
+
* ```ts
|
|
9543
9874
|
* import { Stream, Schedule, Console, Effect } from "effect"
|
|
9544
9875
|
*
|
|
9545
9876
|
* const stream = Stream.zipLatestAll(
|
|
@@ -9557,6 +9888,7 @@ export declare const zipLatest: {
|
|
|
9557
9888
|
* // [ 3, 1, 0 ]
|
|
9558
9889
|
* // [ 3, 1, 1 ]
|
|
9559
9890
|
* // .....
|
|
9891
|
+
* ```
|
|
9560
9892
|
*
|
|
9561
9893
|
* @since 3.3.0
|
|
9562
9894
|
* @category zipping
|
|
@@ -9679,6 +10011,7 @@ export declare const zipRight: {
|
|
|
9679
10011
|
* The new stream will end when one of the sides ends.
|
|
9680
10012
|
*
|
|
9681
10013
|
* @example
|
|
10014
|
+
* ```ts
|
|
9682
10015
|
* import { Effect, Stream } from "effect"
|
|
9683
10016
|
*
|
|
9684
10017
|
* // We create two streams and zip them with custom logic.
|
|
@@ -9690,6 +10023,7 @@ export declare const zipRight: {
|
|
|
9690
10023
|
*
|
|
9691
10024
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9692
10025
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10026
|
+
* ```
|
|
9693
10027
|
*
|
|
9694
10028
|
* @since 2.0.0
|
|
9695
10029
|
* @category zipping
|
|
@@ -9702,6 +10036,7 @@ export declare const zipWith: {
|
|
|
9702
10036
|
* The new stream will end when one of the sides ends.
|
|
9703
10037
|
*
|
|
9704
10038
|
* @example
|
|
10039
|
+
* ```ts
|
|
9705
10040
|
* import { Effect, Stream } from "effect"
|
|
9706
10041
|
*
|
|
9707
10042
|
* // We create two streams and zip them with custom logic.
|
|
@@ -9713,6 +10048,7 @@ export declare const zipWith: {
|
|
|
9713
10048
|
*
|
|
9714
10049
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9715
10050
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10051
|
+
* ```
|
|
9716
10052
|
*
|
|
9717
10053
|
* @since 2.0.0
|
|
9718
10054
|
* @category zipping
|
|
@@ -9725,6 +10061,7 @@ export declare const zipWith: {
|
|
|
9725
10061
|
* The new stream will end when one of the sides ends.
|
|
9726
10062
|
*
|
|
9727
10063
|
* @example
|
|
10064
|
+
* ```ts
|
|
9728
10065
|
* import { Effect, Stream } from "effect"
|
|
9729
10066
|
*
|
|
9730
10067
|
* // We create two streams and zip them with custom logic.
|
|
@@ -9736,6 +10073,7 @@ export declare const zipWith: {
|
|
|
9736
10073
|
*
|
|
9737
10074
|
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
|
|
9738
10075
|
* // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
|
|
10076
|
+
* ```
|
|
9739
10077
|
*
|
|
9740
10078
|
* @since 2.0.0
|
|
9741
10079
|
* @category zipping
|
|
@@ -9777,6 +10115,7 @@ export declare const zipWithChunks: {
|
|
|
9777
10115
|
* Zips each element with the next element if present.
|
|
9778
10116
|
*
|
|
9779
10117
|
* @example
|
|
10118
|
+
* ```ts
|
|
9780
10119
|
* import { Chunk, Effect, Stream } from "effect"
|
|
9781
10120
|
*
|
|
9782
10121
|
* const stream = Stream.zipWithNext(Stream.make(1, 2, 3, 4))
|
|
@@ -9788,6 +10127,7 @@ export declare const zipWithChunks: {
|
|
|
9788
10127
|
* // [ 3, { _id: 'Option', _tag: 'Some', value: 4 } ],
|
|
9789
10128
|
* // [ 4, { _id: 'Option', _tag: 'None' } ]
|
|
9790
10129
|
* // ]
|
|
10130
|
+
* ```
|
|
9791
10131
|
*
|
|
9792
10132
|
* @since 2.0.0
|
|
9793
10133
|
* @category zipping
|
|
@@ -9798,6 +10138,7 @@ export declare const zipWithNext: <A, E, R>(self: Stream<A, E, R>) => Stream<[A,
|
|
|
9798
10138
|
* `None`.
|
|
9799
10139
|
*
|
|
9800
10140
|
* @example
|
|
10141
|
+
* ```ts
|
|
9801
10142
|
* import { Chunk, Effect, Stream } from "effect"
|
|
9802
10143
|
*
|
|
9803
10144
|
* const stream = Stream.zipWithPrevious(Stream.make(1, 2, 3, 4))
|
|
@@ -9809,6 +10150,7 @@ export declare const zipWithNext: <A, E, R>(self: Stream<A, E, R>) => Stream<[A,
|
|
|
9809
10150
|
* // [ { _id: 'Option', _tag: 'Some', value: 2 }, 3 ],
|
|
9810
10151
|
* // [ { _id: 'Option', _tag: 'Some', value: 3 }, 4 ]
|
|
9811
10152
|
* // ]
|
|
10153
|
+
* ```
|
|
9812
10154
|
*
|
|
9813
10155
|
* @since 2.0.0
|
|
9814
10156
|
* @category zipping
|
|
@@ -9818,6 +10160,7 @@ export declare const zipWithPrevious: <A, E, R>(self: Stream<A, E, R>) => Stream
|
|
|
9818
10160
|
* Zips each element with both the previous and next element.
|
|
9819
10161
|
*
|
|
9820
10162
|
* @example
|
|
10163
|
+
* ```ts
|
|
9821
10164
|
* import { Chunk, Effect, Stream } from "effect"
|
|
9822
10165
|
*
|
|
9823
10166
|
* const stream = Stream.zipWithPreviousAndNext(Stream.make(1, 2, 3, 4))
|
|
@@ -9845,6 +10188,7 @@ export declare const zipWithPrevious: <A, E, R>(self: Stream<A, E, R>) => Stream
|
|
|
9845
10188
|
* // { _id: 'Option', _tag: 'None' }
|
|
9846
10189
|
* // ]
|
|
9847
10190
|
* // ]
|
|
10191
|
+
* ```
|
|
9848
10192
|
*
|
|
9849
10193
|
* @since 2.0.0
|
|
9850
10194
|
* @category zipping
|
|
@@ -9854,6 +10198,7 @@ export declare const zipWithPreviousAndNext: <A, E, R>(self: Stream<A, E, R>) =>
|
|
|
9854
10198
|
* Zips this stream together with the index of elements.
|
|
9855
10199
|
*
|
|
9856
10200
|
* @example
|
|
10201
|
+
* ```ts
|
|
9857
10202
|
* import { Effect, Stream } from "effect"
|
|
9858
10203
|
*
|
|
9859
10204
|
* const stream = Stream.make("Mary", "James", "Robert", "Patricia")
|
|
@@ -9865,6 +10210,7 @@ export declare const zipWithPreviousAndNext: <A, E, R>(self: Stream<A, E, R>) =>
|
|
|
9865
10210
|
* // _id: 'Chunk',
|
|
9866
10211
|
* // values: [ [ 'Mary', 0 ], [ 'James', 1 ], [ 'Robert', 2 ], [ 'Patricia', 3 ] ]
|
|
9867
10212
|
* // }
|
|
10213
|
+
* ```
|
|
9868
10214
|
*
|
|
9869
10215
|
* @since 2.0.0
|
|
9870
10216
|
* @category zipping
|
|
@@ -9886,6 +10232,7 @@ export declare const zipWithIndex: <A, E, R>(self: Stream<A, E, R>) => Stream<[A
|
|
|
9886
10232
|
* @see {@link let_ let}
|
|
9887
10233
|
*
|
|
9888
10234
|
* @example
|
|
10235
|
+
* ```ts
|
|
9889
10236
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
9890
10237
|
*
|
|
9891
10238
|
* const result = pipe(
|
|
@@ -9895,6 +10242,7 @@ export declare const zipWithIndex: <A, E, R>(self: Stream<A, E, R>) => Stream<[A
|
|
|
9895
10242
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
9896
10243
|
* )
|
|
9897
10244
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10245
|
+
* ```
|
|
9898
10246
|
*
|
|
9899
10247
|
* @category do notation
|
|
9900
10248
|
* @since 2.0.0
|
|
@@ -9916,6 +10264,7 @@ export declare const Do: Stream<{}>;
|
|
|
9916
10264
|
* @see {@link let_ let}
|
|
9917
10265
|
*
|
|
9918
10266
|
* @example
|
|
10267
|
+
* ```ts
|
|
9919
10268
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
9920
10269
|
*
|
|
9921
10270
|
* const result = pipe(
|
|
@@ -9925,6 +10274,7 @@ export declare const Do: Stream<{}>;
|
|
|
9925
10274
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
9926
10275
|
* )
|
|
9927
10276
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10277
|
+
* ```
|
|
9928
10278
|
*
|
|
9929
10279
|
* @category do notation
|
|
9930
10280
|
* @since 2.0.0
|
|
@@ -9946,6 +10296,7 @@ export declare const bind: {
|
|
|
9946
10296
|
* @see {@link let_ let}
|
|
9947
10297
|
*
|
|
9948
10298
|
* @example
|
|
10299
|
+
* ```ts
|
|
9949
10300
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
9950
10301
|
*
|
|
9951
10302
|
* const result = pipe(
|
|
@@ -9955,6 +10306,7 @@ export declare const bind: {
|
|
|
9955
10306
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
9956
10307
|
* )
|
|
9957
10308
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10309
|
+
* ```
|
|
9958
10310
|
*
|
|
9959
10311
|
* @category do notation
|
|
9960
10312
|
* @since 2.0.0
|
|
@@ -9981,6 +10333,7 @@ export declare const bind: {
|
|
|
9981
10333
|
* @see {@link let_ let}
|
|
9982
10334
|
*
|
|
9983
10335
|
* @example
|
|
10336
|
+
* ```ts
|
|
9984
10337
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
9985
10338
|
*
|
|
9986
10339
|
* const result = pipe(
|
|
@@ -9990,6 +10343,7 @@ export declare const bind: {
|
|
|
9990
10343
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
9991
10344
|
* )
|
|
9992
10345
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10346
|
+
* ```
|
|
9993
10347
|
*
|
|
9994
10348
|
* @category do notation
|
|
9995
10349
|
* @since 2.0.0
|
|
@@ -10064,6 +10418,7 @@ export declare const bindEffect: {
|
|
|
10064
10418
|
* @see {@link let_ let}
|
|
10065
10419
|
*
|
|
10066
10420
|
* @example
|
|
10421
|
+
* ```ts
|
|
10067
10422
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10068
10423
|
*
|
|
10069
10424
|
* const result = pipe(
|
|
@@ -10073,6 +10428,7 @@ export declare const bindEffect: {
|
|
|
10073
10428
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10074
10429
|
* )
|
|
10075
10430
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10431
|
+
* ```
|
|
10076
10432
|
*
|
|
10077
10433
|
* @category do notation
|
|
10078
10434
|
* @since 2.0.0
|
|
@@ -10094,6 +10450,7 @@ export declare const bindTo: {
|
|
|
10094
10450
|
* @see {@link let_ let}
|
|
10095
10451
|
*
|
|
10096
10452
|
* @example
|
|
10453
|
+
* ```ts
|
|
10097
10454
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10098
10455
|
*
|
|
10099
10456
|
* const result = pipe(
|
|
@@ -10103,6 +10460,7 @@ export declare const bindTo: {
|
|
|
10103
10460
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10104
10461
|
* )
|
|
10105
10462
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10463
|
+
* ```
|
|
10106
10464
|
*
|
|
10107
10465
|
* @category do notation
|
|
10108
10466
|
* @since 2.0.0
|
|
@@ -10126,6 +10484,7 @@ export declare const bindTo: {
|
|
|
10126
10484
|
* @see {@link let_ let}
|
|
10127
10485
|
*
|
|
10128
10486
|
* @example
|
|
10487
|
+
* ```ts
|
|
10129
10488
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10130
10489
|
*
|
|
10131
10490
|
* const result = pipe(
|
|
@@ -10135,6 +10494,7 @@ export declare const bindTo: {
|
|
|
10135
10494
|
* Stream.let("sum", ({ x, y }) => x + y)
|
|
10136
10495
|
* )
|
|
10137
10496
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10497
|
+
* ```
|
|
10138
10498
|
*
|
|
10139
10499
|
* @category do notation
|
|
10140
10500
|
* @since 2.0.0
|
|
@@ -10168,6 +10528,7 @@ export {
|
|
|
10168
10528
|
* @see {@link bindEffect}
|
|
10169
10529
|
*
|
|
10170
10530
|
* @example
|
|
10531
|
+
* ```ts
|
|
10171
10532
|
* import { Chunk, Effect, pipe, Stream } from "effect"
|
|
10172
10533
|
*
|
|
10173
10534
|
* const result = pipe(
|
|
@@ -10178,6 +10539,7 @@ export {
|
|
|
10178
10539
|
* )
|
|
10179
10540
|
* assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
|
|
10180
10541
|
*
|
|
10542
|
+
* ```
|
|
10181
10543
|
* @category do notation
|
|
10182
10544
|
* @since 2.0.0
|
|
10183
10545
|
*/
|