// ets_tracing: off import "@effect-ts/system/Operator" import type { DataSource } from "../DataSource/index.js" /** * A `DataSourceAspect` is an aspect that can be weaved into queries. You can * think of an aspect as a polymorphic function, capable of transforming one * data source into another, possibly enlarging the environment type. */ export interface DataSourceAspect { (dataSource: DataSource): DataSource } /** * Returns a new aspect that represents the sequential composition of this * aspect with the specified one. */ export function andThen_( fa: DataSourceAspect, fb: DataSourceAspect ): DataSourceAspect { return (dataSource) => fb(fa(dataSource)) } /** * Returns a new aspect that represents the sequential composition of this * aspect with the specified one. * @ets_data_first andThen_ */ export function andThen( fb: DataSourceAspect ): (fa: DataSourceAspect) => DataSourceAspect { return (fa) => andThen_(fa, fb) }