/* * Copyright 2022 Nina Andrup Pedersen * * 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 iterated, and its functions.///pubmod Iterable {////// Trait for types that can be iterated.////// Instances are immutable data structures.///pubtraitIterable[t] {////// The element type of the Iterable.///typeElm[t]: Type////// The associated effect of creating the Iterable and accessing the elements/// in the underlying data structure or generator.////// The effect is embedded in the type of the Iterator.///typeAef[t]: Eff = {}////// Returns an iterator over `t`.///pubdefiterator(rc: Region[r], t: t): Iterator[Iterable.Elm[t], r + aef, r] \ (r + aef) whereIterable.Aef[t] ~ aef }}