SafeFunction

zio.prelude.SafeFunction
See theSafeFunction companion object
final class SafeFunction[-In, +Out] extends In => Out

A SafeFunction is a function that can be freely composed with the guarantee that functions of arbitrary size can be evaluated in constant stack space. It does this by maintaining each of the composed functions internally in a data structure and evaluating them in a loop when the function is called.

Attributes

Companion
object
Graph
Supertypes
trait In => Out
class Object
trait Matchable
class Any
Self type
SafeFunction[In, Out]

Members list

Value members

Concrete methods

def andThen[Out2](that: SafeFunction[Out, Out2]): SafeFunction[In, Out2]

Composes this function with the specified function to return a new function that feeds the output of this function into the specified function.

Composes this function with the specified function to return a new function that feeds the output of this function into the specified function.

Attributes

def apply(in: In): Out

Evaluates the function with the specified argument.

Evaluates the function with the specified argument.

Attributes

def compose[In2](that: SafeFunction[In2, In]): SafeFunction[In2, Out]

Composes this function with the specified function to return a new function that feeds the output of the specified function into this function.

Composes this function with the specified function to return a new function that feeds the output of the specified function into this function.

Attributes

Inherited methods

def andThen[A](g: Out => A): In => A

Attributes

Inherited from:
Function1
def compose[A](g: A => In): A => Out

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1