Visitor

abstract class Visitor[F[_], A, R] extends Iterant[F, A] => R

Implements the Visitor Pattern for interpreting the Iterant data structure.

Implements the Visitor Pattern for interpreting the Iterant data structure.

This can be used as an alternative to pattern matching and is used in the implementation of Iterant for performance reasons.

WARN: this being a class instead of a recursive function, it means that it often has to keep "shared state". Keeping shared state is great for performance, but breaks referential transparency, so use with care.

trait Iterant[F, A] => R
class Object
trait Matchable
class Any

Value members

Abstract methods

def fail(e: Throwable): R

Processes unhandled errors.

Processes unhandled errors.

def visit(ref: Next[F, A]): R

Processes Iterant.Next.

Processes Iterant.Next.

def visit(ref: NextBatch[F, A]): R

Processes Iterant.NextBatch.

Processes Iterant.NextBatch.

def visit(ref: NextCursor[F, A]): R

Processes Iterant.NextCursor.

Processes Iterant.NextCursor.

def visit(ref: Suspend[F, A]): R

Processes Iterant.Suspend.

Processes Iterant.Suspend.

def visit(ref: Concat[F, A]): R

Processes Iterant.Concat.

Processes Iterant.Concat.

def visit[S](ref: Scope[F, S, A]): R

Processes Iterant.Scope.

Processes Iterant.Scope.

def visit(ref: Last[F, A]): R

Processes Iterant.Last.

Processes Iterant.Last.

def visit(ref: Halt[F, A]): R

Processes Iterant.Halt.

Processes Iterant.Halt.

Concrete methods

def apply(fa: Iterant[F, A]): R

Inherited methods

@unspecialized
def andThen[A](g: R => A): Iterant[F, A] => A
Inherited from
Function1
@unspecialized
def compose[A](g: A => Iterant[F, A]): A => R
Inherited from
Function1
override def toString(): String
Definition Classes
Function1 -> Any
Inherited from
Function1