/* * Copyright 2023 Stephen Tetley * * Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE.md file. */////// Trait for types that can be collected from an iterator, and its functions.///pubmod Collectable {////// Trait for types that can be collected from an iterator.///pubtraitCollectable[t: Type] {////// The element type of the Collectable.///typeElm[t]: Type////// The associated effect of the Collectable which represents the effect of accessing its elements.///typeAef[t]: Eff = {}////// Run an Iterator collecting the results.///pubdefcollect(iter: Iterator[Collectable.Elm[t], ef, r]): t \ (ef + Collectable.Aef[t] + r) }}