effect-io-ai

Package: effect
Module: Array

Array.ReadonlyArray.With

Constructs an array type preserving non-emptiness.

Example (Preserving non-emptiness)

import type { Array } from "effect"

type Result = Array.ReadonlyArray.With<readonly [number], string>
// Result is NonEmptyArray<string>

Signature

type With<S, A> = S extends NonEmptyReadonlyArray<any> ? NonEmptyArray<A>
    : Array<A>

Source

Since v2.0.0