BT
Size: a a a
DM
🎄T
∅ч
∅ч
DM
DM
DM
DM
DM
S
object Gavno -implemented:using Mocha {}
tr
BT
object Gavno -implemented:using Mocha {}
S
extend box< Collection {
fn |T: iso Any, E: iso Exception| map
(using: fn (box< Self.Element) -throws: E -returns: T)
-throws: some iso Exception
-returns: some iso |Element: iso T| Collection {
var `result collection`: box = !recover: {
return |T|Collection.`create default empty collection`(`with initial capacity`: self.count);
};
self.forEach(do: fn {
`result collection`.append(transformer($0));
});
return `result collection`;
};
fn |T: iso Any, E: iso Exception| `safely map`
(using transformer: fn (Self.ELement) -sealed -throws: E -returns: T)
-throws: some iso Exception
-returns: some val |Element: box T| Collection {
var `result collection`: box = !recover: {
return |T|Collection.`create default empty collection`(`with initial capacity`: self.count);
};
self.forEach(do: fn {
`result collection`.append(transformer($0));
});
return `result collection`;
};
};