Hyperlinkv0.8.0-beta.28

MutableList

MutableList.makeconsteffect/MutableList.ts:254
<A>(): MutableList<A>

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"
constructors
export const make = <A>(): MutableList<A> => ({
  head: undefined,
  tail: undefined,
  length: 0
})
Referenced by 5 symbols