com.softwaremill.tagging
package com.softwaremill.tagging
Tag instances with arbitrary types. The tags are usually empty trait
s. Tags have no runtime overhead and are only
used at compile-time for additional type safety.
For example:
class Berry()
trait Black
trait Blue
val berry = new Berry()
val blackBerry: Berry @@ Black = berry.taggedWith[Black]
val blueBerry: Berry @@ Blue = berry.taggedWith[Blue]
// compile error: val anotherBlackBerry: Berry @@ Black = blueBerry
Original idea by Miles Sabin, see: https://gist.github.com/milessabin/89c9b47a91017973a35f
Type members
Classlikes
Implicits
Implicits
final implicit def AndTaggingMapKey[M[_, _], K, A, V](mkv: M[K @@ A, V]): AndTaggingMapKey[M, K, A, V]
final implicit def Function4Tagger[A, B, C, D, E](f: (A, B, C, D) => E): Function4Tagger[A, B, C, D, E]