spire.macrosk

Ops

trait Ops extends AnyRef

This trait has some nice methods for working with implicit Ops classes.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Ops
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def operatorNames: Map[String, String]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def binop[A, R](c: Context)(rhs: scala.reflect.macros.Context.Expr[A]): scala.reflect.macros.Context.Expr[R]

    Given context and an expression, this method rewrites the tree to call the "desired" method with the lhs and rhs parameters.

    Given context and an expression, this method rewrites the tree to call the "desired" method with the lhs and rhs parameters. We find the symbol which is applying the macro and use its name to determine what method to call.

    Users write code like:

    x + y

    After typing and implicit resolution, we get trees like:

    ringOps[A](x:A)(ev:R[A]).+(y:A)

    and we want to get out:

    ev.method(x:A, y:A)

    So, we need to decompose ringOps[A](x)(ev) to get x and ev, and we need to map "+" into "plus".

  8. def binopWithEv[A, Ev, R](c: Context)(rhs: scala.reflect.macros.Context.Expr[A])(ev: scala.reflect.macros.Context.Expr[Ev]): scala.reflect.macros.Context.Expr[R]

  9. def binopWithLift[A, Ev, R](c: Context)(rhs: scala.reflect.macros.Context.Expr[A])(ev1: scala.reflect.macros.Context.Expr[Ev])(implicit arg0: scala.reflect.macros.Context.WeakTypeTag[A]): scala.reflect.macros.Context.Expr[R]

    Given an expression like: xyz(lhs)(ev0).

    Given an expression like: xyz(lhs)(ev0).plus(rhs: Abc)(ev1) This will create a tree like: ev0.plus(lhs, ev1.fromAbc(rhs)) Notably, this let's us use Ring's fromInt method and ConvertableTo's fromDouble (etc.) before applying an op.

  10. def binopWithSelfLift[A, Ev, R](c: Context)(rhs: scala.reflect.macros.Context.Expr[A])(implicit arg0: scala.reflect.macros.Context.WeakTypeTag[A]): scala.reflect.macros.Context.Expr[R]

  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def findMethodName(c: Context): scala.reflect.macros.Universe.TermName

    Provide a canonical mapping between "operator names" used in Ops classes and the actual method names used for type classes.

    Provide a canonical mapping between "operator names" used in Ops classes and the actual method names used for type classes.

    This is an interesting directory of the operators Spire supports. It's also worth noting that we don't (currently) have the capacity to dispatch to two different typeclass-method names for the same operator--typeclasses have to agree to use the same name for the same operator.

    In general "textual" method names should just pass through to the typeclass... it is probably not wise to provide mappings for them here.

  16. def flip[A, R](c: Context)(rhs: scala.reflect.macros.Context.Expr[A]): scala.reflect.macros.Context.Expr[R]

  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def rbinop[A, R](c: Context)(lhs: scala.reflect.macros.Context.Expr[A]): scala.reflect.macros.Context.Expr[R]

    Like binop, but for right-associative operators (eg.

    Like binop, but for right-associative operators (eg. +:).

  24. def rbinopWithEv[A, Ev, R](c: Context)(lhs: scala.reflect.macros.Context.Expr[A])(ev: scala.reflect.macros.Context.Expr[Ev]): scala.reflect.macros.Context.Expr[R]

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. def unop[R](c: Context)(): scala.reflect.macros.Context.Expr[R]

    Given context, this method rewrites the tree to call the desired method with the lhs parameter.

    Given context, this method rewrites the tree to call the desired method with the lhs parameter. We find the symbol which is applying the macro and use its name to determine what method to call.

    Users write code like:

    -x

    After typing and implicit resolution, we get trees like:

    ringOps[A](x:A)(ev:R[A]).unary_-()

    and we want to get out:

    ev.negate(x:A)

    So, we need to decompose ringOps[A](x)(ev) to get x and ev, and we need to map "unary_-" into "negate".

  28. def unopWithEv[Ev, R](c: Context)(ev: scala.reflect.macros.Context.Expr[Ev]): scala.reflect.macros.Context.Expr[R]

  29. def unpack[T[_], A](c: Context): (Tree, Tree)

    Given context, this method pulls 'evidence' and 'lhs' values out of instantiations of implicit -Ops classes.

    Given context, this method pulls 'evidence' and 'lhs' values out of instantiations of implicit -Ops classes. For instance,

    Given "new FooOps(x)(ev)", this method returns (ev, x).

  30. def unpackWithoutEv(c: Context): Tree

  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped