Object

machinist

DefaultOps

Related Doc: package machinist

Permalink

object DefaultOps extends Ops with DefaultOperatorNames

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultOps
  2. DefaultOperatorNames
  3. Ops
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink

    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.

    If we see code like:

    lhs + rhs

    After typing and implicit resolution, we get trees like:

    conversion(lhs)(ev).$plus(rhs: A): R

    The macro should produce trees like:

    ev.method(lhs: A, rhs: A): R
    Definition Classes
    Ops
  6. def binopWithEv[A, Ev, R](c: Context)(rhs: scala.reflect.macros.whitebox.Context.Expr[A])(ev: scala.reflect.macros.whitebox.Context.Expr[Ev]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Like binop, but with ev provided to the method instead of to the implicit constructor.

    Like binop, but with ev provided to the method instead of to the implicit constructor.

    If we see code like:

    lhs % rhs

    After typing and implicit resolution, we get trees like:

    conversion(lhs).$percent(rhs)(ev)

    The macro should produce trees like:

    ev.mod(lhs, rhs)
    Definition Classes
    Ops
  7. def binopWithLift[A, Ev, R](c: Context)(rhs: scala.reflect.macros.whitebox.Context.Expr[A])(ev1: scala.reflect.macros.whitebox.Context.Expr[Ev])(implicit arg0: scala.reflect.macros.whitebox.Context.WeakTypeTag[A]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Combine an implicit enrichment with a lifting method.

    Combine an implicit enrichment with a lifting method.

    If we see code like:

    lhs + 1

    After typing and implicit resolution, we get trees like:

    conversion(lhs)(ev0).$plus(1)(ev1): R

    The macro should produce trees like:

    ev0.plus(lhs, ev1.fromInt(1))

    In Spire, this lets us use Ring's fromInt method and ConvertableTo's fromDouble (etc.) before applying an op. Eventually, we should generalize the way we choose the lifting method.

    Definition Classes
    Ops
  8. def binopWithScalar[A, R](c: Context)(rhs: scala.reflect.macros.whitebox.Context.Expr[A]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Like binop, but where the implementation comes from a child member

    Like binop, but where the implementation comes from a child member

    If we see code like:

    lhs * rhs

    After typing and implicit resolution, we get trees like:

    conversion(lhs)(ev).$times(rhs)

    The macro should produce trees like:

    ev.scalar.times(lhs, rhs)
    Definition Classes
    Ops
  9. def binopWithSelfLift[A, Ev, R](c: Context)(rhs: scala.reflect.macros.whitebox.Context.Expr[A])(implicit arg0: scala.reflect.macros.whitebox.Context.WeakTypeTag[A]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    This is like binopWithLift, but we use the same evidence parameter to make the method call and do the lifting.

    This is like binopWithLift, but we use the same evidence parameter to make the method call and do the lifting.

    If we see code like:

    lhs * 2

    After typing and implicit resolution, we get trees like:

    conversion(lhs)(ev).$times(2): R

    The macro should produce trees like:

    ev.times(lhs, ev.fromInt(2))
    Definition Classes
    Ops
  10. def clone(): AnyRef

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

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

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

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

    Permalink

    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.

    It's worth noting that a particular instance of Ops must always map a given symbol a single method name. If you want to be able to map the same symbol to different names in different contexts, you'll need to create multiple Ops instances and configure them appropriately.

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

    Definition Classes
    Ops
  15. def flip[A, R](c: Context)(rhs: scala.reflect.macros.whitebox.Context.Expr[A]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Similar to binop, but for situations where there is no evidence parameter, and we just want to call a method on the rhs.

    Similar to binop, but for situations where there is no evidence parameter, and we just want to call a method on the rhs.

    After typing and implicit resolution, we get trees like:

    conversion(lhs).foo(rhs)

    and we want to get out:

    rhs.foo(lhs)
    Definition Classes
    Ops
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def handleBinopWithChild[A, R](c: Context)(rhs: scala.reflect.macros.whitebox.Context.Expr[A])(childName: String): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Provided to make defining things like binopWithScalar easier.

    Provided to make defining things like binopWithScalar easier.

    Definition Classes
    Ops
  18. def handleUnopWithChild[R](c: Context)(childName: String): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink
    Definition Classes
    Ops
  19. def hashCode(): Int

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

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

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. val operatorNames: Map[String, String]

    Permalink
    Definition Classes
    DefaultOperatorNames
  25. def rbinop[A, R](c: Context)(lhs: scala.reflect.macros.whitebox.Context.Expr[A]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

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

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

    If we see code like:

    lhs *: rhs

    After typing and implicit resolution, we get trees like:

    conversion(rhs)(ev).$times$colon(lhs)

    The macro should produce trees like:

    ev.timesl(lhs, rhs)
    Definition Classes
    Ops
  26. def rbinopWithEv[A, Ev, R](c: Context)(lhs: scala.reflect.macros.whitebox.Context.Expr[A])(ev: scala.reflect.macros.whitebox.Context.Expr[Ev]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Like rbinop, but with ev provided to the method instead of to the implicit constructor.

    Like rbinop, but with ev provided to the method instead of to the implicit constructor.

    If we see code like:

    lhs *: rhs

    After typing and implicit resolution, we get trees like:

    conversion(rhs).$times$colon(lhs)(ev)

    The macro should produce trees like:

    ev.timesl(lhs, rhs)
    Definition Classes
    Ops
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

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

    Permalink

    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.

    If we see code like:

    -lhs

    After typing and implicit resolution, we get trees like:

    conversion(lhs)(ev).unary_-(): R

    The macro should produce trees like:

    ev.negate(lhs): R
    Definition Classes
    Ops
  30. def unop0[R](c: Context): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    A variant of unop which doesn't take an empty parameter list.

    A variant of unop which doesn't take an empty parameter list.

    Definition Classes
    Ops
  31. def unopWithEv[Ev, R](c: Context)(ev: scala.reflect.macros.whitebox.Context.Expr[Ev]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Like unop, but with ev provided to the method instead of to the implicit constructor.

    Like unop, but with ev provided to the method instead of to the implicit constructor.

    If we see code like:

    lhs.abs

    After typing and implicit resolution, we get trees like:

    conversion(lhs).abs(ev: Ev): R

    The macro should produce trees like:

    ev.abs(lhs): R
    Definition Classes
    Ops
  32. def unopWithEv2[Ev1, R](c: Context)(ev1: scala.reflect.macros.whitebox.Context.Expr[Ev1]): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink

    Like unop and unopWithEv, but there is ev provided by the implicit constructor, and ev1 provided by the method.

    Like unop and unopWithEv, but there is ev provided by the implicit constructor, and ev1 provided by the method.

    If we see code like:

    lhs.isId

    After typing and implicit resolution, we get trees like:

    conversion(lhs)(ev: Ev).isId(ev1: Ev1): R

    The macro should produce trees like:

    ev.isId(lhs)(ev1): R
    Definition Classes
    Ops
  33. def unopWithScalar[R](c: Context)(): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink
    Definition Classes
    Ops
  34. def unopWithScalar0[R](c: Context): scala.reflect.macros.whitebox.Context.Expr[R]

    Permalink
    Definition Classes
    Ops
  35. def unpack[T[_], A](c: Context): (scala.reflect.macros.Universe.Tree, scala.reflect.macros.Universe.Tree)

    Permalink

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

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

    For instance, given a tree like:

    new FooOps(x)(ev)

    This method would return (ev, x).

    Definition Classes
    Ops
  36. def unpackWithoutEv(c: Context): scala.reflect.macros.Universe.Tree

    Permalink

    Given context, this method pulls the 'lhs' value out of instantiations of implicit -Ops classes.

    Given context, this method pulls the 'lhs' value out of instantiations of implicit -Ops classes.

    For instance, given a tree like:

    new FooOps(x)

    This method would return x.

    Definition Classes
    Ops
  37. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DefaultOperatorNames

Inherited from Ops

Inherited from AnyRef

Inherited from Any

Macros

Macro transformations for operators

Ungrouped