Skip to main content
Module

x/fun/array.ts>getInitializableArray

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 getInitializableArray
import { getInitializableArray } from "https://deno.land/x/fun@v2.0.0-alpha.12/array.ts";

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