MCPcopy
hub / github.com/Effect-TS/effect / shift

Function shift

packages/effect/src/MutableList.ts:227–234  ·  view source on GitHub ↗
(self: MutableList<A>)

Source from the content-addressed store, hash-verified

225 * @since 0.0.1
226 */
227export const shift = <A>(self: MutableList<A>): A | undefined => {
228 const head = self.head
229 if (head !== undefined) {
230 remove(self, head)
231 return head.value
232 }
233 return undefined
234}
235
236/**
237 * Removes the last value from the list and returns it, if it exists.

Callers

nothing calls this directly

Calls 1

removeFunction · 0.85

Tested by

no test coverage detected