Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package softwaremill
    Definition Classes
    com
  • package tagging

    Tag instances with arbitrary types.

    Tag instances with arbitrary types. The tags are usually empty traits. 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

    Definition Classes
    softwaremill
  • AndTagger
  • AnyTypeclassTaggingCompat
  • Tag
  • Tagger
  • TypeclassTaggingCompat

package tagging

Tag instances with arbitrary types. The tags are usually empty traits. 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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. tagging
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type @@[+T, +U] = T with Tag[U]
  2. implicit final class AndTagger[T, U] extends AnyVal
  3. trait AnyTypeclassTaggingCompat extends AnyRef
  4. trait Tag[+U] extends Any
  5. type Tagged[+T, +U] = T with Tag[U]
  6. implicit final class Tagger[T] extends AnyVal
  7. trait TypeclassTaggingCompat[Typeclass[_]] extends AnyRef

Inherited from AnyRef

Inherited from Any

Ungrouped