Hyperlinkv0.8.0-beta.28

Iterable

Iterable.prependAllconsteffect/Iterable.ts:244
<B>(that: Iterable<B>): <A>(self: Iterable<A>) => Iterable<A | B>
<A, B>(self: Iterable<A>, that: Iterable<B>): Iterable<A | B>

Prepends the specified prefix iterable to the beginning of the specified iterable.

Example (Prepending another iterable)

import { Iterable } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(
  Array.from(Iterable.prependAll([1, 2], ["a", "b"])),
  ["a", "b", 1, 2]
)
combining
export const prependAll: {
  <B>(that: Iterable<B>): <A>(self: Iterable<A>) => Iterable<A | B>
  <A, B>(self: Iterable<A>, that: Iterable<B>): Iterable<A | B>
} = dual(
  2,
  <A, B>(self: Iterable<A>, that: Iterable<B>): Iterable<A | B> => appendAll(that, self)
)
Referenced by 1 symbols