UNPKG

@effect-ts/system

Version:

Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.

12 lines (9 loc) 337 B
// ets_tracing: off import * as Tp from "../Collections/Immutable/Tuple/index.js" import { access } from "./core.js" /** * Returns an effectful function that merely swaps the elements in a `Tuple2`. */ export function swap<A, B>(__trace?: string) { return access(({ tuple: [a, b] }: Tp.Tuple<[A, B]>) => Tp.tuple(b, a), __trace) }