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
Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class AndTaggingF[F[_], T, U](val ft: F[T @@ U]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class AndTaggingF2[F1[_], F2[_], T, U](val ft: F1[F2[T @@ U]]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class AndTaggingMapKey[M[_, _], K, A, V](val mkv: M[K @@ A, V]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object AnyTypeclassTaggingCompat
object AnyTypeclassTaggingCompat extends AnyTypeclassTaggingCompat
Attributes
- Companion
- trait
- Supertypes
- Self type
final implicit class Function2Tagger[A, B, C](val f: (A, B) => C) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class Function3Tagger[A, B, C, D](val f: (A, B, C) => D) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class Function4Tagger[A, B, C, D, E](val f: (A, B, C, D) => E) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class FunctionTagger[A, B](val f: A => B) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
Attributes
- Supertypes
-
class Any
final implicit class Tagger[T](val t: T) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class TaggingF[F[_], T](val fa: F[T]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class TaggingF2[F1[_], F2[_], T](val ft: F1[F2[T]]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
final implicit class TaggingMapKey[M[_, _], K, V](val mkv: M[K, V]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
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]
In this article