object Tag
- Source
- Tag.scala
- Alphabetic
- By Inheritance
- Tag
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
class
TagOf
[T] extends ~>[Id.Id, [α$0$]TagKind.@@[α$0$, T]]
- See also
Tag.of
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[A, T](a: A): @@[A, T]
subst
specialized toId
.subst
specialized toId
.- Annotations
- @inline()
- To do
According to Miles, @specialized doesn't help here. Maybe manually specialize.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val k: TagKind
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
of[T]: TagOf[T]
Variants of
apply
,subst
, andunsubst
that require specifying the tag type but are more likely to infer the other type parameters. -
def
subst[A, F[_], T](fa: F[A]): F[@@[A, T]]
Add a tag
T
toA
.Add a tag
T
toA
.NB: It is unwise to
subst
orunsubst
a tag in anF
that is sensitive to theA
type within. For example, ifF
is a GADT, rather than a normal ADT, it will be type-correct, but probably not what you expect. For "normal" types likeList
and function types, it is safe. More broadly, if it is possible to write a legal scalaz.InvariantFunctor over the parameter,subst
of that parameter is safe. This is becausesubst
effectively provides evidence that a type and all its tagged variants are equal; tagging works to discriminate types because that fact is not implicit to the compiler.We do not have a type role system in Scala with which to declare the exact situations under which
subst
is safe. If we did, we would declare thatsubst
is safe if and only if the parameter has "representational" or "phantom" role.- Annotations
- @inline()
-
def
subst1[G[_], F[_[_]], T](fa: F[G]): F[[α]TagKind.@@[G[α], T]]
Add a tag
T
toG[_]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unsubst[A, F[_], T](fa: F[@@[A, T]]): F[A]
Remove the tag
T
, leavingA
.Remove the tag
T
, leavingA
.- Annotations
- @inline()
-
def
unsubst1[G[_], F[_[_]], T](fa: F[[α]TagKind.@@[G[α], T]]): F[G]
Remove the tag
T
, leavingG
Remove the tag
T
, leavingG
- Annotations
- @inline()
-
def
unwrap[A, T](a: @@[A, T]): A
unsubst
specialized toId
.unsubst
specialized toId
.- Annotations
- @inline()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )