Skip to main content
Module

x/fun/fn.ts>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 todo
import { todo } from "https://deno.land/x/fun@v.2.0.0-alpha.11/fn.ts";

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!!