Packages

  • package root
    Definition Classes
    root
  • package izumi
    Definition Classes
    root
  • package functional
    Definition Classes
    izumi
  • package bio

    Current hierarchy (use http://www.nomnoml.com/ to render, rendered: https://izumi.7mind.io/bio/media/bio-relationship-hierarchy.svg)

    Current hierarchy (use http://www.nomnoml.com/ to render, rendered: https://izumi.7mind.io/bio/media/bio-relationship-hierarchy.svg)

    [Functor2]<--[Bifunctor2]
    [Bifunctor2]<--[ApplicativeError2]
    [Functor2]<--[Applicative2]
    [Applicative2]<--[Guarantee2]
    [Applicative2]<--[Monad2]
    [Guarantee2]<--[ApplicativeError2]
    [ApplicativeError2]<--[Error2]
    [Monad2]<--[Error2]
    [Error2]<--[Bracket2]
    [Bracket2]<--[Panic2]
    [Panic2]<--[IO2]
    [IO2]<--[Async2]
    
    [Monad2]<--[Parallel2]
    [Parallel2]<--[Concurrent2]
    [Concurrent2]<--[Async2]
    
    [Error2]<--[Temporal2]

    Auxiliary algebras:

    [cats.effect.*]<:--[CatsConversions]
    
    [Fork2]<:--[Fiber2]
    
    [BlockingIO2]
    
    [Primitives2]
    
    [Primitives2]<:--[Ref2]
    [Primitives2]<:--[Semaphore2]
    [Primitives2]<:--[Promise2]
    
    [PrimitivesM2]
    [PrimitivesM2]<:--[RefM2]
    [PrimitivesM2]<:--[Mutex2]
    
    [Entropy1]<:--[Entropy2]
    [Clock1]<:--[Clock2]
    
    [UnsafeRun2]

    Raw inheritance hierarchy:

    [Functor2]<--[Applicative2]
    [Applicative2]<--[Guarantee2]
    [Applicative2]<--[Monad2]
    [Guarantee2]<--[ApplicativeError2]
    [Bifunctor2]<--[ApplicativeError2]
    [ApplicativeError2]<--[Error2]
    [Monad2]<--[Error2]
    [Error2]<--[Bracket2]
    [Bracket2]<--[Panic2]
    [Panic2]<--[IO2]
    
    [Parallel2]<--[Concurrent2]
    [Concurrent2]<--[Async2]
    [IO2]<--[Async2]
    
    [Temporal2]

    current hierarchy roots:

    bifunctor:

    • Functor3
    • Bifunctor3
    • Parallel3
    • Temporal3

    standalone:

    • Fork3
    • BlockingIO3
    • Primitives3
    • PrimitivesM3
    Definition Classes
    functional
  • package data
    Definition Classes
    bio
  • package impl
    Definition Classes
    bio
  • package retry
    Definition Classes
    bio
  • package syntax
    Definition Classes
    bio
  • Syntax2

package syntax

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. trait Syntax2 extends ImplicitPuns

    All implicit syntax in BIO is available automatically without wildcard imports with the help of so-called "implicit punning", as in the following example:

    All implicit syntax in BIO is available automatically without wildcard imports with the help of so-called "implicit punning", as in the following example:

    import izumi.functional.bio.Monad2
    
    def loop[F[+_, +_]: Monad2]: F[Nothing, Nothing] = {
      val unitEffect: F[Nothing, Unit] = Monad2[F].unit
      unitEffect.flatMap(loop)
    }

    Note that a .flatMap method is available on the unitEffect value of an abstract type parameter F, even though we did not import any syntax implicits using a wildcard import.

    The flatMap method was added by the implicit punning on the Monad2 name. In short, implicit punning just means that instead of creating a companion object for a type with the same name as the type, we create "companion" implicit conversions with the same name. So that whenever you import the type, you are also always importing the syntax-providing implicit conversions.

    This happens to be a great fit for Tagless Final Style, since nearly all TF code will import the names of the used typeclasses.

    Implicit Punning for typeclass syntax relieves the programmer from having to manually import syntax implicits in every file in their codebase.

    Note

    The order of conversions is such to allow otherwise conflicting type classes to not conflict, e.g. code using constraints such as def x[F[+_, +_]: Functor2: Applicative2: Monad2] will compile and run normally when using syntax, despite ambiguity of implicits caused by all 3 implicits inheriting from Functor2. This is because, due to the priority order being from most-specific to least-specific, the Monad2 syntax will be used in such a case, where the Monad2[F] implicit is actually unambiguous.

Value Members

  1. object Syntax2

Ungrouped