score:7

Accepted answer

it would be nice in this situation to be able to write something like this:

trait actionbuilder2[r[_] <: request[_]] extends
  actionbuilderbase[r, genericaction[_, r]]

to indicate that you want to partially apply genericaction. unfortunately that's not valid scala syntax (although erik osheim has a compiler plugin that lets you write something very similar).

you can use the "type lambda trick", however:

trait actionbuilder2[r[_] <: request[_]] extends
  actionbuilderbase[r, ({ type l[a] = genericaction[a, r] })#l]

see this answer for a detailed explanation of how it works.


Related Query

More Query from same tag