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

thunk

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

Create a Comparable for thunk types.

@example
import { struct, thunk, number } from "./comparable.ts";

const { compare } = struct({ asNumber: thunk(number) });

const one = { asNumber: () => 1 };
const two = { asNumber: () => 2 };

const result1 = compare(one)(two); // false
const result2 = compare(one)(one); // true
function thunk<A>({ compare }: Comparable<A>): Comparable<() => A>;
§
thunk<A>({ compare }: Comparable<A>): Comparable<() => A>
[src]

§Type Parameters

§Parameters

§
{ compare }: Comparable<A>
[src]

§Return Type