+ Flix supports associate types, which allow the types in instance signatures + to depend on the instance type. +
+ +
+ The code on the right defines a trait with an associated type Elm
,
+ which enables each Coll
instance to define its element type.
+
+ Associated effects allow the effects in trait members to depend on the instance type. + This makes it easy to create abstractions over both pure and effectful operations, + and mutable and immutable data structures. +
+ +
+ The code on the left adds an associated effect Aef
to the Coll
trait,
+ which makes it possible to add instances for mutable collections.
+