higher-kinded types
2009-06-24 22:49:56 GMT
All,
Am i correct in concluding that the solution in The Moors-Piessens-Odersky paper only works with collections that have been clever enough to have used type members rather that type parameters? Or, is there a trick to making the vast majority of the collections types that are parametrically typed look as if they have type members? (See example below.)
Best wishes,
--greg
// Paraphrasing the basic Moors-Piessens-Odersky construction
trait TypeCtor1 { type E }
trait Brace[A] extends TypeCtor1 {
type C <: TypeCtor1
def nest( a : A ) : C{type E = A}
def flatten( bsq : C{type E=C{type E=A}} ) : C{type E=A}
}
// Now, how to make a version of BraceList since List is parametrically typed?
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117
+1 206.650.3740
http://biosimilarity.blogspot.com
RSS Feed