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.
Source: stackoverflow.com
Related Query
- Higher kind/type bound puzzler in Scala
- Lower type bound on Scala field in mutable, covariant class?
- Getting Scala type bound error: not found: type <%<
- Partially applied type lambda in Scala with kind projector
- How to define an existential higher kinded type in Scala
- Scala Option type upper bound don't understand
- Scala and type bound with a given operation
- Higher kinded type constructor with upper type bounds doesn't work if bound is abstract type member
- Scala higher kinded type variance
- Type bound error when creating a tuple in scala
- Upper and Lower bound on scala type
- Another subtype after a type bound in scala
- Why do I need an explicit evidence type / why does this Scala type bound fail?
- Type bound in Scala function complicates piping to method reference
- Scala lower type bound 'is a subtype' restriction on method arguments
- scala type class with higher kinded types and variance
- Scala upper and lower type bound
- Why is f-bounded polymorphism im Scala commonly implemented with an upper type bound as well as a self type
- Scala higher kinded type syntax
- Scala type parameter vs. type field when extending higher kinded type
- The difference between Scala type bound and generalized type constraints
- Can I use a type bound on a Scala abstract method and then "tighten up" the definition in a subclass?
- Recursive higher order function type in Scala 3
- How to define a context bound with a higher kinded Type (Type Constructor)
- How to avoid duplication of type bound in Scala
- Scala bound type parameter and reflection
- Scala and UnionTypes bound to a generic type
- How to set type parameter bound in scala to make generic function for numerics?
- Type upper bound in Scala Mapper/Record traits
- Scala - How to Return this Kind of RDD type
More Query from same tag
- scala: trait for a Function object with variable length arguments?
- Intellij build scala module showing error with scalac:Error:scala/xml/MetaData
- Getting map function with custom CanBuildFrom and Builder to work in Scala
- Scala: how to implement a java interface that contains scala "typed" classes without their type parameters
- Scala Spark: Calling Fortran Subroutine in Spark
- Why is VectorBuilder in the package scala.collections.immutable?
- Chunked Response from an Iterator with Play Framework in Scala
- JSON support for companion object
- sbt-native-packager: Scala App on Alpine Docker Image fails with permission denied
- Capture argument to partial function
- How to find out which dependency includes wrong version of Play/Scala in sbt
- docker.io - Docker linking between application & database containers
- I'm developing an application similar to fb chat. Which framework - Play or Django?
- spark write parquet to HDFS very slow on multi node
- apache spark streaming kafka integration error JAVA
- Databricks to_avro works only if schema is registered without specified event name and namespace
- java.lang.NoClassDefFoundError for spark-submit
- Play Framework 2.0. Upgrade bonecp
- Scala: Function0 vs by-name parameters
- why an action takes multiple jobs to get completed in spark - scala
- Meaning of Play Application class
- Can this 'if' statement be removed?
- Point IntelliJ to installed Scala
- How to add a column from different data frame : Scala Frame
- Find the direct and indirect successors of a node (scala-graph)
- Create control constructs without funny restrictions on line breaks in Scala DSL
- Looking for examples for structures that apply some but not all properties of a Monad
- when does it need explicit type when declare variable in scala?
- SecureSocial : Extending BasicProfile adding attributes in Securesocial 3.0-M4, play 2.4
- Right click in selenium webdriver problems