/** * @since 1.0.0 */ import type * as Chunk from "@effect/data/Chunk" import type * as Context from "@effect/data/Context" import type * as Debug from "@effect/data/Debug" import type * as Duration from "@effect/data/Duration" import type * as Either from "@effect/data/Either" import type { LazyArg } from "@effect/data/Function" import type * as Option from "@effect/data/Option" import type * as Cause from "@effect/io/Cause" import type * as Effect from "@effect/io/Effect" import type * as Layer from "@effect/io/Layer" import type * as Cache from "@effect/query/Cache" import type * as DataSource from "@effect/query/DataSource" import type * as Described from "@effect/query/Described" import * as internal from "@effect/query/internal_effect_untraced/query" import type * as Result from "@effect/query/internal_effect_untraced/result" import type * as Request from "@effect/query/Request" /** * @since 1.0.0 * @category symbols */ export const QueryTypeId: unique symbol = internal.QueryTypeId /** * @since 1.0.0 * @category symbols */ export type QueryTypeId = typeof QueryTypeId /** * A `Query` is a purely functional description of an effectual query * that may contain requests from one or more data sources, requires an * environment `R`, and may fail with an `E` or succeed with an `A`. * * Requests that can be performed in parallel, as expressed by `zipWithPar` and * combinators derived from it, will automatically be batched. Requests that * must be performed sequentially, as expressed by `zipWith` and combinators * derived from it, will automatically be pipelined. This allows for aggressive * data source specific optimizations. Requests can also be deduplicated and * cached. * * This allows for writing queries in a high level, compositional style, with * confidence that they will automatically be optimized. For example, consider * the following query from a user service. * * ```ts * import * as Chunk from "@effect/data/Chunk" * import * as Query from "@effect/query/Query" * * declare const getAllUserIds: Query.Query> * declare const getUserNameById: (id: number) => Query.Query * * const userNames = pipe( * getAllUserIds, * Query.flatMap(Query.forEachPar(getUserNameById)) * ) * ``` * * This would normally require `N + 1` queries, one for `getAllUserIds` and one * for each call to `getUserNameById`. In contrast, `Query` will automatically * optimize this to two queries, one for `userIds` and one for `userNames`, * assuming an implementation of the user service that supports batching. * * Based on "There is no Fork: an Abstraction for Efficient, Concurrent, and * Concise Data Access" by Simon Marlow, Louis Brandy, Jonathan Coens, and Jon * Purdy. {@link http://simonmar.github.io/bib/papers/haxl-icfp14.pdf} * * @since 1.0.0 * @category models */ export interface Query extends Query.Variance, Effect.Effect { traced(trace: Debug.Trace): Query /** @internal */ readonly i0: Effect.Effect> } /** * @since 1.0.0 */ export declare namespace Query { /** * @since 1.0.0 * @category models */ export interface Variance { readonly [QueryTypeId]: { readonly _R: (_: never) => R readonly _E: (_: never) => E readonly _A: (_: never) => A } } } /** * Returns a query which submerges the error case of `Either` into the error * channel of the query * * The inverse of `Query.either`. * * @since 1.0.0 * @category combinators */ export const absolve: (self: Query>) => Query = internal.absolve /** * Executes the requests for a query between two effects, `before` and `after`, * where the result of `before` can be used by `after`. * * @since 1.0.0 * @category combinators */ export const around: { ( before: Described.Described>, after: Described.Described<(a: A2) => Effect.Effect> ): (self: Query) => Query ( self: Query, before: Described.Described>, after: Described.Described<(a: A2) => Effect.Effect> ): Query } = internal.around /** * Maps the success value of this query to the specified constant value. * * @since 1.0.0 * @category mapping */ export const as: { (value: A2): (self: Query) => Query (self: Query, value: A2): Query } = internal.as /** * Lifts the error channel into a `Some` value for composition with other * optional queries. * * @since 1.0.0 * @category mapping */ export const asSomeError: (self: Query) => Query, A> = internal.asSomeError /** * Maps the success value of this query to unit. * * @since 1.0.0 * @category mapping */ export const asUnit: (self: Query) => Query = internal.asUnit /** * Enables caching for this query. Note that caching is enabled by default so * this will only be effective to enable caching in part of a larger query in * which caching has been disabled. * * @since 1.0.0 * @category combinators */ export const cached: (self: Query) => Query = internal.cached /** * Recovers from all expected errors. * * @since 1.0.0 * @category error handling */ export const catchAll: { (f: (error: E) => Query): (self: Query) => Query (self: Query, f: (error: E) => Query): Query } = internal.catchAll /** * Recovers from all errors, both expected and unexpected, with provided * `Cause`. * * @since 1.0.0 * @category error handling */ export const catchAllCause: { ( f: (cause: Cause.Cause) => Query ): (self: Query) => Query ( self: Query, f: (cause: Cause.Cause) => Query ): Query } = internal.catchAllCause /** * Collects a collection of queries into a query returning a collection of * their results. Requests will be executed sequentially and will be * pipelined. * * @since 1.0.0 * @category combinators */ export const collectAll: (queries: Iterable>) => Query> = internal.collectAll /** * Collects a collection of queries into a query returning a collection of * their results, batching requests to data sources. * * @since 1.0.0 * @category combinators */ export const collectAllBatched: (queries: Iterable>) => Query> = internal.collectAllBatched /** * Collects a collection of queries into a query returning a collection of * their results. Requests will be executed in parallel and will be batched. * * @since 1.0.0 * @category combinators */ export const collectAllPar: (queries: Iterable>) => Query> = internal.collectAllPar /** * Accesses the whole context of the query. * * @since 1.0.0 * @category context */ export const context: (_: void) => Query> = internal.context /** * Accesses the context of the effect. * * @since 1.0.0 * @category context */ export const contextWith: (f: (context: Context.Context) => A) => Query = internal.contextWith /** * Effectfully accesses the context of the effect. * * @since 1.0.0 * @category context */ export const contextWithEffect: ( f: (context: Context.Context) => Effect.Effect ) => Query = internal.contextWithEffect /** * Effectfully accesses the context of the effect. * * @since 1.0.0 * @category context */ export const contextWithQuery: ( f: (context: Context.Context) => Query ) => Query = internal.contextWithQuery /** * Provides this query with part of its required context. * * @since 1.0.0 * @category context */ export const contramapContext: { ( f: Described.Described<(context: Context.Context) => Context.Context> ): (self: Query) => Query ( self: Query, f: Described.Described<(context: Context.Context) => Context.Context> ): Query } = internal.contramapContext /** * Constructs a query that dies with the specified defect. * * @since 1.0.0 * @category constructors */ export const die: (defect: unknown) => Query = internal.die /** * Constructs a query that dies with the specified lazily evaluated defect. * * @since 1.0.0 * @category constructors */ export const dieSync: (evaluate: LazyArg) => Query = internal.dieSync /** * Returns a query whose failure and success have been lifted into an * `Either`. The resulting query cannot fail, because the failure case has * been exposed as part of the `Either` success case. * * @since 1.0.0 * @category combinators */ export const either: (self: Query) => Query> = internal.either /** * Ensures that if this query starts executing, the specified query will be * executed immediately after this query completes execution, whether by * success or failure. * * @since 1.0.0 * @category finalization */ export const ensuring: { (finalizer: Query): (self: Query) => Query (self: Query, finalizer: Query): Query } = internal.ensuring /** * Constructs a query that fails with the specified error. * * @since 1.0.0 * @category constructors */ export const fail: (error: E) => Query = internal.fail /** * Constructs a query that fails with the specified lazily evaluated error. * * @since 1.0.0 * @category constructors */ export const failSync: (evaluate: LazyArg) => Query = internal.failSync /** * Constructs a query that fails with the specified cause. * * @since 1.0.0 * @category constructors */ export const failCause: (cause: Cause.Cause) => Query = internal.failCause /** * Constructs a query that fails with the specified cause. * * @since 1.0.0 * @category constructors */ export const failCauseSync: (evaluate: LazyArg>) => Query = internal.failCauseSync /** * Returns a query that models execution of this query, followed by passing * its result to the specified function that returns a query. Requests * composed with `flatMap` or combinators derived from it will be executed * sequentially and will not be pipelined, though deduplication and caching of * requests may still be applied. * * @since 1.0.0 * @category sequencing */ export const flatMap: { (f: (a: A) => Query): (self: Query) => Query (self: Query, f: (a: A) => Query): Query } = internal.flatMap /** * Returns a query that performs the outer query first, followed by the inner * query, yielding the value of the inner query. * * This method can be used to "flatten" nested queries. * * @since 1.0.0 * @category sequencing */ export const flatten: (self: Query>) => Query = internal.flatten /** * Performs a query for each element in a collection, collecting the results * into a query returning a collection of their results. Requests will be * executed sequentially and will be pipelined. * * @since 1.0.0 * @category traversing */ export const forEach: { (f: (a: A) => Query): (elements: Iterable) => Query> (elements: Iterable, f: (a: A) => Query): Query> } = internal.forEach /** * Performs a query for each element in a collection, batching requests to * data sources and collecting the results into a query returning a collection * of their results. * * @since 1.0.0 * @category traversing */ export const forEachBatched: { (f: (a: A) => Query): (elements: Iterable) => Query> (elements: Iterable, f: (a: A) => Query): Query> } = internal.forEachBatched /** * Performs a query for each element in a collection, collecting the results * into a query returning a collection of their results. Requests will be * executed in parallel and will be batched. * * @since 1.0.0 * @category traversing */ export const forEachPar: { (f: (a: A) => Query): (elements: Iterable) => Query> (elements: Iterable, f: (a: A) => Query): Query> } = internal.forEachPar /** * Constructs a query from an effect. * * @since 1.0.0 * @category constructors */ export const fromEffect: (effect: Effect.Effect) => Query = internal.fromEffect /** * Constructs a query from an `Either`. * * @since 1.0.0 * @category constructors */ export const fromEither: (either: Either.Either) => Query = internal.fromEither /** * Constructs a query from an `Option`. * * @since 1.0.0 * @category constructors */ export const fromOption: (option: Option.Option) => Query, A> = internal.fromOption /** * Constructs a query from a request and a data source. Queries will die with * a `QueryFailure` when run if the data source does not provide results for * all requests received. Queries must be constructed with `fromRequest` or * one of its variants for optimizations to be applied. * * @since 1.0.0 * @category constructors */ export const fromRequest: , A2 extends A>( request: A, dataSource: DataSource.DataSource ) => Query, Request.Request.Success> = internal.fromRequest /** * Constructs a query from a request and a data source but does not apply * caching to the query. * * @since 1.0.0 * @category constructors */ export const fromRequestUncached: , A2 extends A>( request: A, dataSource: DataSource.DataSource ) => Query, Request.Request.Success> = internal.fromRequestUncached /** * This function returns `true` if the specified value is an `Query` value, * `false` otherwise. * * This function can be useful for checking the type of a value before * attempting to operate on it as an `Query` value. For example, you could * use `isQuery` to check the type of a value before using it as an * argument to a function that expects an `Query` value. * * @param u - The value to check for being an `Query` value. * * @returns `true` if the specified value is an `Query` value, `false` * otherwise. * * @since 1.0.0 * @category refinements */ export const isQuery: (u: unknown) => u is Query = internal.isQuery /** * "Zooms in" on the value in the `Left` side of an `Either`, moving the * possibility that the value is a `Right` to the error channel. * * @since 1.0.0 * @category combinators */ export const left: (self: Query>) => Query, A> = internal.left /** * Maps the specified function over the successful result of this query. * * @since 1.0.0 * @category mapping */ export const map: { (f: (a: A) => B): (self: Query) => Query (self: Query, f: (a: A) => B): Query } = internal.map /** * Returns a query whose failure and success channels have been mapped by the * specified pair of functions, `f` and `g`. * * @since 1.0.0 * @category mapping */ export const mapBoth: { (f: (e: E) => E2, g: (a: A) => A2): (self: Query) => Query (self: Query, f: (e: E) => E2, g: (a: A) => A2): Query } = internal.mapBoth /** * Transforms all data sources with the specified data source aspect. * * @since 1.0.0 * @category mapping */ export const mapDataSources: { ( f: (dataSource: DataSource.DataSource) => DataSource.DataSource ): (self: Query) => Query ( self: Query, f: (dataSource: DataSource.DataSource) => DataSource.DataSource ): Query } = internal.mapDataSources /** * Maps the specified function over the failed result of this query. * * @since 1.0.0 * @category mapping */ export const mapError: { (f: (e: E) => E2): (self: Query) => Query (self: Query, f: (e: E) => E2): Query } = internal.mapError /** * Returns a query with its full cause of failure mapped using the specified * function. This can be used to transform errors while preserving the * original structure of `Cause`. * * @since 1.0.0 * @category mapping */ export const mapErrorCause: { (f: (cause: Cause.Cause) => Cause.Cause): (self: Query) => Query (self: Query, f: (cause: Cause.Cause) => Cause.Cause): Query } = internal.mapErrorCause /** * Maps the specified effectual function over the result of this query. * * @since 1.0.0 * @category mapping */ export const mapEffect: { (f: (a: A) => Effect.Effect): (self: Query) => Query (self: Query, f: (a: A) => Effect.Effect): Query } = internal.mapEffect /** * Folds over the failed or successful result of this query to yield a query * that does not fail, but succeeds with the value returned by the left or * right function passed to `match`. * * @since 1.0.0 * @category folding */ export const match: { (onFailure: (error: E) => Z, onSuccess: (value: A) => Z): (self: Query) => Query (self: Query, onFailure: (error: E) => Z, onSuccess: (value: A) => Z): Query } = internal.match /** * A more powerful version of `foldQuery` that allows recovering from any type * of failure except interruptions. * * @since 1.0.0 * @category folding */ export const matchCauseQuery: { ( onFailure: (cause: Cause.Cause) => Query, onSuccess: (value: A) => Query ): (self: Query) => Query ( self: Query, onFailure: (cause: Cause.Cause) => Query, onSuccess: (value: A) => Query ): Query } = internal.matchCauseQuery /** * Recovers from errors by accepting one query to execute for the case of an * error, and one query to execute for the case of success. * * @since 1.0.0 * @category folding */ export const matchQuery: { ( onFailure: (error: E) => Query, onSuccess: (value: A) => Query ): (self: Query) => Query ( self: Query, onFailure: (error: E) => Query, onSuccess: (value: A) => Query ): Query } = internal.matchQuery /** * Limits the query data sources to execute at most `n` requests in parallel. * * @since 1.0.0 * @category combinators */ export const maxBatchSize: { (n: number): (self: Query) => Query (self: Query, n: number): Query } = internal.maxBatchSize /** * Constructs a query that never completes. * * @since 1.0.0 * @category constructors */ export const never: (_: void) => Query = internal.never /** * Converts this query to one that returns `Some` if data sources return * results for all requests received and `None` otherwise. * * @since 1.0.0 * @category combinators */ export const optional: (self: Query) => Query> = internal.optional /** * Converts this query to one that dies if a query failure occurs. * * @since 1.0.0 * @category error handling */ export const orDie: (self: Query) => Query = internal.orDie /** * Converts this query to one that dies if a query failure occurs, using the * specified function to map the error to a defect. * * @since 1.0.0 * @category error handling */ export const orDieWith: { (f: (error: E) => unknown): (self: Query) => Query (self: Query, f: (error: E) => unknown): Query } = internal.orDieWith /** * Performs a query for each element in a collection, collecting the results * into a collection of failed results and a collection of successful results. * Requests will be executed sequentially and will be pipelined. * * @since 1.0.0 * @category combinators */ export const partitionQuery: { ( f: (a: A) => Query ): (elements: Iterable) => Query, Chunk.Chunk]> ( elements: Iterable, f: (a: A) => Query ): Query, Chunk.Chunk]> } = internal.partitionQuery /** * Performs a query for each element in a collection, collecting the results * into a collection of failed results and a collection of successful results. * Requests will be executed in parallel and will be batched. * * @since 1.0.0 * @category combinators */ export const partitionQueryPar: { ( f: (a: A) => Query ): (elements: Iterable) => Query, Chunk.Chunk]> ( elements: Iterable, f: (a: A) => Query ): Query, Chunk.Chunk]> } = internal.partitionQueryPar /** * Provides this query with its required context. * * @since 1.0.0 * @category context */ export const provideContext: { (context: Described.Described>): (self: Query) => Query (self: Query, context: Described.Described>): Query } = internal.provideContext /** * Provides a layer to this query, which translates it to another level. * * @since 1.0.0 * @category context */ export const provideLayer: { (layer: Described.Described>): (self: Query) => Query (self: Query, layer: Described.Described>): Query } = internal.provideLayer /** * Splits the environment into two parts, providing one part using the * specified layer and leaving the remainder `R0`. * * @since 1.0.0 * @category context */ export const provideSomeLayer: { ( layer: Described.Described> ): (self: Query) => Query, E2 | E, A> ( self: Query, layer: Described.Described> ): Query, E | E2, A> } = internal.provideSomeLayer /** * Races this query with the specified query, returning the result of the * first to complete successfully and safely interrupting the other. * * @since 1.0.0 * @category combinators */ export const race: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.race /** * Keeps some of the errors, and terminates the query with the rest. * * @since 1.0.0 * @category error handling */ export const refineOrDie: { (pf: (error: E) => Option.Option): (self: Query) => Query (self: Query, pf: (error: E) => Option.Option): Query } = internal.refineOrDie /** * Keeps some of the errors, and terminates the query with the rest, using the * specified function to convert the `E` into a defect. * * @since 1.0.0 * @category error handling */ export const refineOrDieWith: { ( pf: (error: E) => Option.Option, f: (error: E) => unknown ): (self: Query) => Query (self: Query, pf: (error: E) => Option.Option, f: (error: E) => unknown): Query } = internal.refineOrDieWith /** * "Zooms in" on the value in the `Right` side of an `Either`, moving the * possibility that the value is a `Left` to the error channel. * * @since 1.0.0 * @category combinators */ export const right: (self: Query>) => Query, A2> = internal.right /** * Returns an effect that models executing this query. * * @since 1.0.0 * @category destructors */ export const run: (self: Query) => Effect.Effect = internal.run /** * Returns an effect that models executing this query with the specified * cache. * * @since 1.0.0 * @category destructors */ export const runCache: { (cache: Cache.Cache): (self: Query) => Effect.Effect (self: Query, cache: Cache.Cache): Effect.Effect } = internal.runCache /** * Returns an effect that models executing this query, returning the query * result along with the cache. * * @since 1.0.0 * @category destructors */ export const runLog: (self: Query) => Effect.Effect = internal.runLog /** * Expose the full cause of failure of this query. * * @since 1.0.0 * @category combinators */ export const sandbox: (self: Query) => Query, A> = internal.sandbox /** * Companion helper to `sandbox`. Allows recovery, and partial recovery, from * errors and defects alike, as in: * * @since 1.0.0 * @category combinators */ export const sandboxWith: { ( f: (self: Query, A>) => Query, A2> ): (self: Query) => Query ( self: Query, f: (self: Query, A>) => Query, A2> ): Query } = internal.sandboxWith /** * Extracts a `Some` value into the value channel while moving the `None` into * the error channel for easier composition * * Inverse of `Query.unoption`. * * @since 1.0.0 * @category combinators */ export const some: (self: Query>) => Query, A> = internal.some /** * Extracts the optional value or succeeds with the given 'default' value. * * @since 1.0.0 * @category combinators */ export const someOrElse: { (def: LazyArg): (self: Query>) => Query (self: Query>, def: LazyArg): Query } = internal.someOrElse /** * Extracts the optional value or executes the given 'default' query. * * @since 1.0.0 * @category combinators */ export const someOrElseEffect: { ( def: LazyArg> ): (self: Query>) => Query ( self: Query>, def: LazyArg> ): Query } = internal.someOrElseEffect /** * Extracts the optional value or fails with the given error `e`. * * @since 1.0.0 * @category combinators */ export const someOrFail: { (error: LazyArg): (self: Query>) => Query (self: Query>, error: LazyArg): Query } = internal.someOrFail /** * Constructs a query that succeeds with the specified value. * * @since 1.0.0 * @category constructors */ export const succeed: (value: A) => Query = internal.succeed /** * Constructs a query that succeds with the empty value. * * @since 1.0.0 * @category constructors */ export const succeedNone: (_: void) => Query> = internal.succeedNone /** * Constructs a query that succeeds with the optional value. * * @since 1.0.0 * @category constructors */ export const succeedSome: (value: A) => Query> = internal.succeedSome /** * Summarizes a query by computing some value before and after execution, and * then combining the values to produce a summary, together with the result of * execution. * * @since 1.0.0 * @category combinators */ export const summarized: { ( summary: Effect.Effect, f: (start: B, end: B) => C ): (self: Query) => Query ( self: Query, summary: Effect.Effect, f: (start: B, end: B) => C ): Query } = internal.summarized /** * Returns a lazily constructed query. * * @since 1.0.0 * @category constructors */ export const suspend: (evaluate: LazyArg>) => Query = internal.suspend /** * Constructs a query that succeeds with the specified lazily evaluated value. * * @since 1.0.0 * @category constructors */ export const sync: (evaluate: LazyArg) => Query = internal.sync /** * Returns a new query that executes this one and times the execution. * * @since 1.0.0 * @category combinators */ export const timed: (self: Query) => Query = internal.timed /** * Returns an effect that will timeout this query, returning `None` if the * timeout elapses before the query was completed. * * @since 1.0.0 * @category combinators */ export const timeout: { (duration: Duration.Duration): (self: Query) => Query> (self: Query, duration: Duration.Duration): Query> } = internal.timeout /** * The same as `Query.timeout`, but instead of producing a `None` in the event * of timeout, it will produce the specified error. * * @since 1.0.0 * @category combinators */ export const timeoutFail: { (error: LazyArg, duration: Duration.Duration): (self: Query) => Query (self: Query, error: LazyArg, duration: Duration.Duration): Query } = internal.timeoutFail /** * The same as `Query.timeout`, but instead of producing a `None` in the event * of timeout, it will produce the specified failure. * * @since 1.0.0 * @category combinators */ export const timeoutFailCause: { ( evaluate: LazyArg>, duration: Duration.Duration ): (self: Query) => Query ( self: Query, evaluate: LazyArg>, duration: Duration.Duration ): Query } = internal.timeoutFailCause /** * Returns a query that will timeout this query, returning either the default * value if the timeout elapses before the query has completed or the result * of applying the function `f` to the successful result of the query. * * @since 1.0.0 * @category combinators */ export const timeoutTo: { (def: B2, f: (a: A) => B, duration: Duration.Duration): (self: Query) => Query (self: Query, def: B2, f: (a: A) => B, duration: Duration.Duration): Query } = internal.timeoutTo /** * Disables caching for this query. * * @since 1.0.0 * @category combinators */ export const uncached: (self: Query) => Query = internal.uncached /** * The query that succeeds with the unit value. * * @since 1.0.0 * @category constructors */ export const unit: (_: void) => Query = internal.unit /** * Converts a `Query, A>` into a `Query>`. * * The inverse of `left`. * * @since 1.0.0 * @category combinators */ export const unleft: (self: Query, A>) => Query> = internal.unleft /** * Converts an option on errors into an option on values. * * @since 1.0.0 * @category combinators */ export const unoption: (self: Query, A>) => Query> = internal.unoption /** * Takes some fiber failures and converts them into errors. * * @since 1.0.0 * @category combinators */ export const unrefine: { (pf: (defect: unknown) => Option.Option): (self: Query) => Query (self: Query, pf: (defect: unknown) => Option.Option): Query } = internal.unrefine /** * Takes some fiber failures and converts them into errors, using the * specified function to convert the error. * * @since 1.0.0 * @category combinators */ export const unrefineWith: { ( pf: (defect: unknown) => Option.Option, f: (error: E) => E3 ): (self: Query) => Query ( self: Query, pf: (defect: unknown) => Option.Option, f: (error: E) => E3 ): Query } = internal.unrefineWith /** * Converts a `Query, A>` into a `Query>`. * * The inverse of `right`. * * @since 1.0.0 * @category combinators */ export const unright: (self: Query, A>) => Query> = internal.unright /** * The inverse operation `Query.sandbox`. * * @since 1.0.0 * @category combinators */ export const unsandbox: (self: Query, A>) => Query = internal.unsandbox /** * Unwraps a query that is produced by an effect. * * @since 1.0.0 * @category combinators */ export const unwrap: (effect: Effect.Effect>) => Query = internal.unwrap /** * Returns a query that models the execution of this query and the specified * query sequentially, combining their results into a tuple. * * @since 1.0.0 * @category zipping */ export const zip: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zip /** * Returns a query that models the execution of this query and the specified * query, batching requests to data sources and combining their results into a * tuple. * * @since 1.0.0 * @category zipping */ export const zipBatched: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipBatched /** * Returns a query that models the execution of this query and the specified * query, batching requests to data sources and returning the result of this * query. * * @since 1.0.0 * @category zipping */ export const zipBatchedLeft: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipBatchedLeft /** * Returns a query that models the execution of this query and the specified * query, batching requests to data sources and returning the result of the * specified query. * * @since 1.0.0 * @category zipping */ export const zipBatchedRight: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipBatchedRight /** * Returns a query that models the execution of this query and the specified * query sequentially, returning the result of this query. * * @since 1.0.0 * @category zipping */ export const zipLeft: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipLeft /** * Returns a query that models the execution of this query and the specified * query sequentially, returning the result of the specified query. * * @since 1.0.0 * @category zipping */ export const zipRight: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipRight /** * Returns a query that models the execution of this query and the specified * query in parallel, combining their results into a tuple. * * @since 1.0.0 * @category zipping */ export const zipPar: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipPar /** * Returns a query that models the execution of this query and the specified * query in parallel, returning the result of this query. * * @since 1.0.0 * @category zipping */ export const zipParLeft: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipParLeft /** * Returns a query that models the execution of this query and the specified * query in parallel, returning the result of the specified query. * * @since 1.0.0 * @category zipping */ export const zipParRight: { (that: Query): (self: Query) => Query (self: Query, that: Query): Query } = internal.zipParRight /** * Returns a query that models the execution of this query and the specified * query sequentially, combining their results with the specified function. * Requests composed with `zipWith` or combinators derived from it will * automatically be pipelined. * * @since 1.0.0 * @category zipping */ export const zipWith: { ( that: Query, f: (a: A, b: B) => C ): ( self: Query ) => Query ( self: Query, that: Query, f: (a: A, b: B) => C ): Query } = internal.zipWith /** * Returns a query that models the execution of this query and the specified * query, batching requests to data sources. * * @since 1.0.0 * @category zipping */ export const zipWithBatched: { ( that: Query, f: (a: A, b: B) => C ): ( self: Query ) => Query ( self: Query, that: Query, f: (a: A, b: B) => C ): Query } = internal.zipWithBatched /** * Returns a query that models the execution of this query and the specified * query in parallel, combining their results with the specified function. * Requests composed with `zipWithPar` or combinators derived from it will * automatically be batched. * * @since 1.0.0 * @category zipping */ export const zipWithPar: { ( that: Query, f: (a: A, b: B) => C ): ( self: Query ) => Query ( self: Query, that: Query, f: (a: A, b: B) => C ): Query } = internal.zipWithPar