Scala type identification function at the type parameter level

I can declare an abstract type like

type A[B] 

and in the subclass define what how

 type A[B] = Option[B] 

if I want A to be an option. And if I want A to be B, I can do this:

 type A[B] = B 

Can I achieve the same with type parameters instead of type members?

+7
source share
1 answer

Try a higher option:

 class Foo[A[_]] { ... } type Id[A] = A type Foo1 = Foo[Option] type Foo2 = Foo[Id] 
+6
source

All Articles