Skip to main content
Module

x/fun/mod.ts>fn.todo

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function fn.todo
import { fn } from "https://deno.land/x/fun@v2.0.0-alpha.12/mod.ts";
const { todo } = fn;

A function that can be called to output any type. It's used for type hole based programming. This allows one to define interfaces and types for a function and stub them with todo() until you are ready to implement the actual behavior. The todo function will throw if it is ever actually called.

Examples

Example 1

import { todo } from "./fn.ts";

type InOut = {
  read: () => Promise<string>,
  write: (s: string) => Promise<unknown>,
}

const mockInOut: InOut = todo(); // InOut !!THROWS!!