diff --git a/src/foreach-yield.md b/src/foreach-yield.md index 22c4f7e..6260e69 100644 --- a/src/foreach-yield.md +++ b/src/foreach-yield.md @@ -46,11 +46,16 @@ The workhorse behind the `foreach-yield` construct is the `Iterable` trait (discussed in the previous section) and the `Collectable` trait. ```flix -pub trait Collectable[m: Type -> Type] { +pub trait Collectable[t: Type] { + /// + /// The element type of the Collectable. + /// + type Elm[t]: Type + /// /// Run an Iterator collecting the results. /// - pub def collect(iter: Iterator[a, r]): m[a] \ r with Order[a] + pub def collect(iter: Iterator[Collectable.Elm[t], ef, r]): t \ (ef + Collectable.Aef[t] + r) } ``` diff --git a/src/foreach.md b/src/foreach.md index ef27932..22e57c3 100644 --- a/src/foreach.md +++ b/src/foreach.md @@ -79,11 +79,16 @@ defines a single signature: /// /// A trait for immutable data structures that can be iterated. /// -pub trait Iterable[t: Type -> Type] { +pub trait Iterable[t] { + /// + /// The element type of the Iterable. + /// + type Elm[t]: Type + /// /// Returns an iterator over `t`. /// - pub def iterator(rc: Region[r], t: t[a]): Iterator[a, r, r] \ r + pub def iterator(rc: Region[r], t: t): Iterator[Iterable.Elm[t], r + aef, r] \ (r + aef) where Iterable.Aef[t] ~ aef } ```