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

Function fromIterable

packages/effect/src/MutableList.ts:114–120  ·  view source on GitHub ↗
(iterable: Iterable<A>)

Source from the content-addressed store, hash-verified

112 * @category constructors
113 */
114export const fromIterable = <A>(iterable: Iterable<A>): MutableList<A> => {
115 const list = empty<A>()
116 for (const element of iterable) {
117 append(list, element)
118 }
119 return list
120}
121
122/**
123 * Creates a new `MutableList` from the specified elements.

Callers 1

makeFunction · 0.70

Calls 2

appendFunction · 0.85
emptyFunction · 0.70

Tested by

no test coverage detected