Functoid

izumi.distage.model.providers.Functoid
See theFunctoid companion class

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Functoid.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Inherited methods

final inline def bindAllImplicits[I, N <: IndiscriminateFunctoidDummyImplicit](inline f: N ?=> Functoid[I]): Functoid[I]

Like bindImplicits, but converts even fully resolved implicits into Functoid parameters.

Like bindImplicits, but converts even fully resolved implicits into Functoid parameters.

This may not be what you want, because this will also capture global utility implicits such as DummyImplicit, ClassTag and scala.collection.Factory, and turn them into DI parameters.

Attributes

Inherited from:
FunctoidBindImplicitsVersionSpecific
final inline def bindImplicits[I, N <: UnresolvedOnlyFunctoidDummyImplicit](inline f: N ?=> Functoid[I]): Functoid[I]

Convert unresolved implicits in the following code block, lambda or a method reference into explicit parameters that will be resolved from the object graph, not the implicit context.

Convert unresolved implicits in the following code block, lambda or a method reference into explicit parameters that will be resolved from the object graph, not the implicit context.

Example:

 final case class X(a: Int, b: Double)

 // LAMBDA:

 make[X].from(bindImplicits {
   (i: Int) => X(i, implicitly[Double])
 }

 // transforms into:

 make[X].from {
   (i: Int, d: Double) => X(i, d)
 }

 // CODE BLOCK:

 make[X].from(bindImplicits {
   X(implicitly[Int], implicitly[Double])
 })

 // transforms into:

 make[X].from {
   (i: Int, d: Double) => X(i, d)
 }

 // METHOD REFERENCE:

 def createX(i: Int)(implicit d: Double, dx: DummyImplicit): X = X(i, d)

 make[X].from(bindImplicits {
   createX
 })

 // transforms into:

 make[X].from {
   (i: Int, d: Double) => createX(i)(using d, DummyImplicit.dummyImplicit)
 }

 // because search for DummyImplicit was __resolved__ in current implicit scope, it was taken from the implicit context,
 // not from the object graph!

Attributes

Note

This function is available inside ModuleDef DSL, but it can also be called outside of it as Functoid.bindImplicits

Inherited from:
FunctoidBindImplicitsVersionSpecific
def identity[A : Tag]: Functoid[A]

Attributes

Inherited from:
SimpleFunctoids (hidden)
def identityKey[A](key: DIKey): Functoid[A]

Attributes

Inherited from:
SimpleFunctoids (hidden)
def lift[A : Tag](a: => A): Functoid[A]

Attributes

Inherited from:
SimpleFunctoids (hidden)

Derive constructor for a concrete class A using ClassConstructor

Derive constructor for a concrete class A using ClassConstructor

Attributes

Inherited from:
FunctoidConstructors (hidden)

Derive constructor for a "factory-like" abstract class or a trait A using FactoryConstructor

Derive constructor for a "factory-like" abstract class or a trait A using FactoryConstructor

Attributes

See also
Inherited from:
FunctoidConstructors (hidden)
def makeHas[A : ZEnvConstructor]: Functoid[ZEnvironment[A]]

Derive constructor for a zio.ZEnvironment value A using ZEnvConstructor

Derive constructor for a zio.ZEnvironment value A using ZEnvConstructor

Attributes

See also
Inherited from:
FunctoidConstructors (hidden)

Derive constructor for an abstract class or a trait A using TraitConstructor

Derive constructor for an abstract class or a trait A using TraitConstructor

Attributes

See also
Inherited from:
FunctoidConstructors (hidden)
def pure[A : Tag](a: A): Functoid[A]

Attributes

Inherited from:
SimpleFunctoids (hidden)
def single[A : Tag, B : Tag](f: A => B): Functoid[B]

Attributes

Inherited from:
SimpleFunctoids (hidden)
def singleton[A <: Singleton : Tag](a: A): Functoid[A]

Attributes

Inherited from:
SimpleFunctoids (hidden)
def todoProvider(key: DIKey)(implicit pos: CodePositionMaterializer): Functoid[Nothing]

Attributes

Inherited from:
SimpleDistageFunctoids
def unit: Functoid[Unit]

Attributes

Inherited from:
SimpleFunctoids (hidden)

Deprecated and Inherited methods

Attributes

Deprecated
Same as `makeClass`, use `makeClass`
Inherited from:
FunctoidConstructors (hidden)

Implicits

Inherited implicits

implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, , ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: (, ) => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: () => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: () => R): Functoid[R]

Attributes

Inherited from:
FunctoidMacroMethods
implicit inline def apply[R](inline fun: R)(using isInsideBindImplicits: FunctoidDummyImplicit): Functoid[R]

Allow conversion from argument-less blocks, but only within a bindImplicits block

Allow conversion from argument-less blocks, but only within a bindImplicits block

 make[X].from(bindImplicits {
   makeX
 })

 def makeX(implicit d: ImplicitDependency) = new X(d)

Attributes

Inherited from:
FunctoidMacroByNameConversion
final implicit def providerFromCats[F[_], A](resource: => Resource[F, A])(implicit evidence$1: Tag[F], tag: Tag[FromCats[F, A]]): Functoid[FromCats[F, A]]

Allows you to bind cats.effect.Resource-based constructors in ModuleDef:

Allows you to bind cats.effect.Resource-based constructors in ModuleDef:

Example:

 import cats.effect._

 val catsResource = Resource.liftF(IO(5))

 val module = new distage.ModuleDef {
   make[Int].fromResource(catsResource)
 }

Attributes

Note

binding a cats Resource[F, A] will add a dependency on Sync[F] for your corresponding F type (Sync[F] instance will generally be provided automatically via izumi.distage.modules.DefaultModule)

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def providerFromZIOScoped[R, E, A](scoped: => ZIO[Scope & R, E, A])(implicit tag: Tag[FromZIO[R, E, A]]): Functoid[FromZIO[R, E, A]]

Allows you to bind Scoped zio.ZIO-based constructors in ModuleDef:

Allows you to bind Scoped zio.ZIO-based constructors in ModuleDef:

Attributes

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def providerFromZIOScopedNothing[R, A](scoped: => ZIO[Scope & R, Nothing, A])(implicit tag: Tag[FromZIO[R, Nothing, A]]): Functoid[FromZIO[R, Nothing, A]]

Allows you to bind Scoped zio.ZIO-based constructors in ModuleDef:

Allows you to bind Scoped zio.ZIO-based constructors in ModuleDef:

Attributes

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def providerFromZLayer[R, E, A](layer: => ZLayer[R, E, A])(implicit evidence$1: Tag[A], tag: Tag[FromZIO[R, E, A]]): Functoid[FromZIO[R, E, A]]

Allows you to bind zio.ZLayer-based constructors in ModuleDef:

Allows you to bind zio.ZLayer-based constructors in ModuleDef:

Attributes

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def providerFromZLayerNothing[R, A](layer: => ZLayer[R, Nothing, A])(implicit evidence$1: Tag[A], tag: Tag[FromZIO[R, Nothing, A]]): Functoid[FromZIO[R, Nothing, A]]

Allows you to bind zio.ZLayer-based constructors in ModuleDef:

Allows you to bind zio.ZLayer-based constructors in ModuleDef:

Attributes

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def providerFromZManaged[R, E, A](managed: => ZManaged[R, E, A])(implicit tag: Tag[FromZIO[R, E, A]]): Functoid[FromZIO[R, E, A]]

Allows you to bind zio.managed.ZManaged-based constructors in ModuleDef:

Allows you to bind zio.managed.ZManaged-based constructors in ModuleDef:

Attributes

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def providerFromZManagedNothing[R, A](managed: => ZManaged[R, Nothing, A])(implicit tag: Tag[FromZIO[R, Nothing, A]]): Functoid[FromZIO[R, Nothing, A]]

Allows you to bind zio.managed.ZManaged-based constructors in ModuleDef:

Allows you to bind zio.managed.ZManaged-based constructors in ModuleDef:

Attributes

Inherited from:
FunctoidLifecycleAdapters (hidden)
final implicit def syntaxMapSame[A](functoid: Functoid[A]): SyntaxMapSame[A, Functoid]

Attributes

Inherited from:
SimpleFunctoidSyntax