|
Scala example source code file (cyclics-pos.scala)
The Scala cyclics-pos.scala source codetrait Param[T] trait Abs { type T } trait Cyclic1[A <: Param[A]] // works trait Cyclic2[A <: Abs { type T <: A }] trait Cyclic3 { type A <: Abs { type T = A } } trait Cyclic4 { type A <: Param[A] } // works trait Cyclic5 { type AA <: Abs; type A <: AA { type T = A } } trait IterableTemplate { type Elem type Constr <: IterableTemplate type ConstrOf[A] = Constr { type Elem = A } def iterator: Iterator[Elem] def map [B] (f: Elem => B): ConstrOf[B] def foreach(f: Elem => Unit) = iterator.foreach(f) } trait Iterable[A] extends IterableTemplate { self => type Elem type Constr <: Iterable[A] { type Constr <: Iterable.this.Constr } } Other Scala examples (source code examples)Here is a short list of links related to this Scala cyclics-pos.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.