Package

supertagged

Permalink

package supertagged

Original idea (using base trait TaggedType & type Companion = Companion.Type from: Alexander Semenov (https://github.com/Treev-io/tagged-types)

Enhanced with unified syntax, recursive(on type level) tagging and overcoming some compiler bugs

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

Type Members

  1. type @@[T, +U] = T with Tag[T, U]

    Permalink
  2. trait ClassicTagger[U] extends AnyRef

    Permalink

    Classic way.

    Classic way. Original idea: Miles Sabin

  3. trait LifterF[F[_]] extends AnyRef

    Permalink

    Lift ( Adopted and simplified from: https://github.com/softwaremill/scala-common/blob/master/tagging/src/main/scala/com/softwaremill/tagging/TypeclassTaggingCompat.scala) *

  4. trait NewType[T, Tag0] extends AnyRef

    Permalink
  5. trait NewTypeF[R, Tag] extends NewType[R, Tag]

    Permalink
  6. type Newtype[Repr, Ops] = AnyRef { type T = supertagged.package.Tag[Repr,Ops] }

    Permalink

    NEW TYPES (based on Miles Sabin shapeless.newtype )

  7. class OverTagged[R, T <: TaggedType[R]] extends TaggedType[R with Tag[R, supertagged.OverTagged.T.Tag]]

    Permalink

    New name: Overtagged

  8. implicit final class PostfixSugar[C] extends AnyVal

    Permalink

    For pretty coding value @@ MyTag

  9. sealed trait Tag[T, +U] extends Any

    Permalink

    Making universal trait for overcoming feature bug(knowing as [I cannot be cast to [Ljava.lang.Object; - see at TestScalacBug).

    Making universal trait for overcoming feature bug(knowing as [I cannot be cast to [Ljava.lang.Object; - see at TestScalacBug). Everything seems ok for now. There is no runtime overhead(after jit). Casting doesn't change memory model, boxing for primitive types appears only at specific corner cases and JIT cleans generated rubbish bytecode very well

  10. type Tagged[T, +U] = T with Tag[T, U]

    Permalink
  11. trait TaggedType[T] extends AnyRef

    Permalink

    Example: object Width extends TaggedType[Int] type Width = Width.Type // this for pretty coding: def method(v:Width)

  12. trait TaggedTypeF[T] extends TaggedType[T]

    Permalink

    Need one more trait in chain.

    Need one more trait in chain. Do not cut and optimize it!

  13. trait Tagger[TagIn, Tag, U, SubType, C] extends AnyRef

    Permalink

    Magic starts here *

Value Members

  1. def @@[U]: ClassicTagger[U]

    Permalink
  2. def NewTypeF[Raw, Tag]: NewTypeF[Raw, Tag]

    Permalink
  3. def TaggedTypeF[T]: TaggedTypeF[T]

    Permalink
  4. object Tagger

    Permalink
  5. implicit def liftLifterF[F[_], T, U](implicit f: F[T], lifter: LifterF[F]): F[@@[T, U]]

    Permalink
  6. object lifterF

    Permalink
  7. implicit def newtypeOps[Repr, Ops](t: Newtype[Repr, Ops])(implicit mkOps: (Repr) ⇒ Ops): Ops

    Permalink
  8. def tag[U]: ClassicTagger[U]

    Permalink
  9. def untag[T, U](value: @@[T, U]): T

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped