import { InternalTPriorityQueue } from "@effect/core/stm/TPriorityQueue/operations/_internal/InternalTPriorityQueue"
/**
* Makes a new `TPriorityQueue` initialized with provided `Collection`.
*
* @tsplus static effect/core/stm/TPriorityQueue.Ops from
*/
export function from(ord: Ord) {
return (data: Collection): STM> =>
TRef.make(
data.reduce(SortedMap.empty>(ord), (map, a) => map.set(a, Chunk.single(a)))
).map((map) => new InternalTPriorityQueue(map))
}