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

wrap

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

Wraps a value into an Identity type. This function allows any value to be lifted into the context of an Identity, making it possible to interact with other functions that operate on the Identity type.

@example
import { wrap } from "./identity.ts";

// numberIdentity is Identity<number> with value 5
const numberIdentity = wrap(5);

// stringIdentity is Identity<string> with value "hello"
const stringIdentity = wrap("hello");
function wrap<A>(a: A): Identity<A>;
§
wrap<A>(a: A): Identity<A>
[src]

§Type Parameters

§Parameters

§
a: A
[src]
  • The value to wrap.

§Return Type

§

The wrapped value as an Identity.