Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>array.getInitializableArray

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

Create an instance of Initializable<ReadonlyArray> given a type A. This instance uses array compose and default as the instance methods for the Initializable.

Examples

Example 1

import * as A from "./array.ts";
import { pipe } from "./fn.ts";

const { init, combine } = A.getInitializableArray<number>();

const result = pipe(
  init(), // []
  combine([1, 2, 3]),
); // [1, 2, 3]

Type Parameters

optional
A = never

Returns

Initializable<ReadonlyArray<A>>