Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

swap

import { swap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/pair.ts";

Creates a new Pair with the first and second values swapped.

@example
import * as P from "./pair.ts";
import { pipe } from "./fn.ts";

const shouldBe2 = pipe(
  P.pair(1, 2),
  P.swap,
  P.first
); // 2
function swap<A, B>([firstsecond]: Pair<A, B>): Pair<B, A>;
§
swap<A, B>([firstsecond]: Pair<A, B>): Pair<B, A>
[src]

§Type Parameters

§Parameters

§
[firstsecond]: Pair<A, B>
[src]

§Return Type