Packages

object Instance

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

Type Members

  1. type Aux[M0[_]] = Instance { type M[x] = M0[x] }
  2. type Aux2[M0[_], N[_]] = Instance { type M[x] = M0[N[x]] }
  3. class Composed[A[_], B[_]] extends Instance
  4. final class Input[U <: Universe with Singleton] extends AnyRef
  5. trait Transform[C <: Context with Singleton, N[_]] extends AnyRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final val ApplyName: String("app")
  5. final val FlattenName: String("flatten")
  6. final val InstanceTCName: String("M")
  7. final val MapName: String("map")
  8. final val PureName: String("pure")
  9. implicit def applicativeInstance[A[_]](implicit ap: Applicative[A]): Aux[A]
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  12. def compose[A[_], B[_]](implicit a: Aux[A], b: Aux[B]): Aux2[A, B]
  13. def contImpl[T, N[_]](c: Context, i: Instance with Singleton, convert: Convert, builder: TupleBuilder, linter: LinterDSL)(t: Either[scala.reflect.macros.blackbox.Context.Expr[T], scala.reflect.macros.blackbox.Context.Expr[(i)#M[T]]], inner: Transform[c.type, N])(implicit tt: scala.reflect.macros.blackbox.Context.WeakTypeTag[T], nt: scala.reflect.macros.blackbox.Context.WeakTypeTag[N[T]], it: scala.reflect.macros.blackbox.Context.TypeTag[i]): scala.reflect.macros.blackbox.Context.Expr[(i)#M[N[T]]]

    Implementation of a macro that provides a direct syntax for applicative functors and monads.

    Implementation of a macro that provides a direct syntax for applicative functors and monads. It is intended to be used in conjunction with another macro that conditions the inputs.

    This method processes the Tree t to find inputs of the form wrap[T]( input ) This form is typically constructed by another macro that pretends to be able to get a value of type T from a value convertible to M[T]. This wrap(input) form has two main purposes. First, it identifies the inputs that should be transformed. Second, it allows the input trees to be wrapped for later conversion into the appropriate M[T] type by convert. This wrapping is necessary because applying the first macro must preserve the original type, but it is useful to delay conversion until the outer, second macro is called. The wrap method accomplishes this by allowing the original Tree and Type to be hidden behind the raw T type. This method will remove the call to wrap so that it is not actually called at runtime.

    Each input in each expression of the form wrap[T]( input ) is transformed by convert. This transformation converts the input Tree to a Tree of type M[T]. The original wrapped expression wrap(input) is replaced by a reference to a new local val x: T, where x is a fresh name. These converted inputs are passed to builder as well as the list of these synthetic ValDefs. The TupleBuilder instance constructs a tuple (Tree) from the inputs and defines the right hand side of the vals that unpacks the tuple containing the results of the inputs.

    The constructed tuple of inputs and the code that unpacks the results of the inputs are then passed to the i, which is an implementation of Instance that is statically accessible. An Instance defines a applicative functor associated with a specific type constructor and, if it implements MonadInstance as well, a monad. Typically, it will be either a top-level module or a stable member of a top-level module (such as a val or a nested module). The with Singleton part of the type verifies some cases at macro compilation time, while the full check for static accessibility is done at macro expansion time. Note: Ideally, the types would verify that i: MonadInstance when t.isRight. With the various dependent types involved, this is not worth it.

    The t argument is the argument of the macro that will be transformed as described above. If the macro that calls this method is for a multi-input map (app followed by map), t should be the argument wrapped in Left. If this is for multi-input flatMap (app followed by flatMap), this should be the argument wrapped in Right.

  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def idTransform[C <: Context with Singleton]: Transform[C, Types.Id]
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped