effect-io-ai

Package: effect
Module: MutableList

MutableList.make

Creates an empty MutableList.

Example (Creating an empty mutable list)

import { MutableList } from "effect"

const list = MutableList.make<string>()

// Add elements
MutableList.append(list, "first")
MutableList.append(list, "second")
MutableList.prepend(list, "beginning")

console.log(list.length) // 3

// Take elements in FIFO order (from head)
console.log(MutableList.take(list)) // "beginning"
console.log(MutableList.take(list)) // "first"
console.log(MutableList.take(list)) // "second"

Signature

declare const make: <A>() => MutableList<A>

Source

Since v2.0.0