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

id

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

A thunk over the identity function. It allows one to constrain an identity to a specific type.

@example
import { id } from "./fn.ts";

const idString = id<string>(); // (s: string) => string
const idNumber = id<number>(); // (n: number) => number

const result1 = idString("Hello"); // "Hello"
const result2 = idNumber(1); // 1
function id<A>(): Fn<A, A>;
§
id<A>(): Fn<A, A>
[src]

§Type Parameters

§Return Type

§
Fn<A, A>
[src]