Hyperlinkv0.8.0-beta.28

Chunk

Chunk.joinconsteffect/Chunk.ts:2830
(sep: string): (self: Chunk<string>) => string
(self: Chunk<string>, sep: string): string

Joins the elements together with "sep" in the middle.

Example (Joining chunks into a string)

import { Chunk } from "effect"

const chunk = Chunk.make("apple", "banana", "cherry")
const result = Chunk.join(chunk, ", ")
console.log(result) // "apple, banana, cherry"

// With different separator
const withPipe = Chunk.join(chunk, " | ")
console.log(withPipe) // "apple | banana | cherry"

// Empty chunk
const empty = Chunk.empty<string>()
console.log(Chunk.join(empty, ", ")) // ""

// Single element
const single = Chunk.make("hello")
console.log(Chunk.join(single, ", ")) // "hello"
folding
Source effect/Chunk.ts:28304 lines
export const join: {
  (sep: string): (self: Chunk<string>) => string
  (self: Chunk<string>, sep: string): string
} = RA.join