MCPcopy Create free account
hub / github.com/Effect-TS/effect / prepend

Function prepend

packages/effect/src/MutableList.ts:247–256  ·  view source on GitHub ↗
(self: MutableList<A>, message: A)

Source from the content-addressed store, hash-verified

245 * @since 2.0.0
246 */
247export const prepend = <A>(self: MutableList<A>, message: A): void => {
248 self.head = {
249 array: [message],
250 mutable: true,
251 offset: 0,
252 next: self.head
253 }
254 if (!self.tail) self.tail = self.head
255 self.length++
256}
257
258/**
259 * Prepends all elements from an iterable to the beginning of the MutableList.

Callers 1

Array.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected