PolyFunction

smithy4s.PolyFunction
trait PolyFunction[F[_], G[_]]

Natural transformation, turning a polymorphic type into another, whilst keeping the type parameter intact.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type

Members list

Concise view

Value members

Abstract methods

def apply[A](fa: F[A]): G[A]

Concrete methods

final def andThen[H[_]](other: PolyFunction[G, H]): PolyFunction[F, H]
final def mapK[H[_]](fk: PolyFunction[G, H]): PolyFunction[F, H]
final def unsafeCache(allPossibleInputs: Vector[Existential[F]]): PolyFunction[F, G]

Pre-computes the polyfunction by applying it on a vector of possible inputs.

Pre-computes the polyfunction by applying it on a vector of possible inputs.

Unsafe because calling the resulting polyfunction with an input that wasn't cached will result in an exception.

Attributes

final def unsafeMemoise: PolyFunction[F, G]

Creates a memoised version of this function.

Creates a memoised version of this function.

Unsafe because it creates mutable state, which is a non-referentially-transparent action (aka a side-effect).

Attributes