Packages

t

endpoints4s

PartialInvariantFunctor

trait PartialInvariantFunctor[F[_]] extends InvariantFunctor[F]

Given a type constructor F, a partial function A => Validated[B] and a total function B => A, turns an F[A] into an F[B].

A partial invariant functor is an invariant functor whose covariant transformation function is total (ie, A => Valid[B]).

Source
InvariantFunctor.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PartialInvariantFunctor
  2. InvariantFunctor
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def xmapPartial[A, B](fa: F[A], f: (A) => Validated[B], g: (B) => A): F[B]

    Transforms an F[A] value into an F[B] value given a partial function from A to B, and a total function from B to A.

    Transforms an F[A] value into an F[B] value given a partial function from A to B, and a total function from B to A.

    This is useful to refine the type A into a possibly smaller type B.

    See also

    Some examples

Concrete Value Members

  1. def xmap[A, B](fa: F[A], f: (A) => B, g: (B) => A): F[B]

    Transforms an F[A] value into an F[B] value given a pair of functions from A to B and from B to A.

    Transforms an F[A] value into an F[B] value given a pair of functions from A to B and from B to A.

    Definition Classes
    PartialInvariantFunctorInvariantFunctor
    See also

    Some examples

  2. final def xmapWithCodec[A, B](fa: F[A], codec: Codec[A, B]): F[B]

    Transforms an F[A] value into an F[B] value given a Codec[A, B].

    Transforms an F[A] value into an F[B] value given a Codec[A, B].

    This is useful to refine the type A into a possibly smaller type B.

    See also

    Some examples