package util
- Alphabetic
- Public
- Protected
Type Members
- class DebugIterator[X] extends Iterator[X]
TESTME
TESTME
- X
the underlying type of the iterator.
- case class FPException(msg: String, eo: Option[Throwable] = None) extends Exception with Product with Serializable
A simple case class representing a custom exception for functional programming-related errors.
A simple case class representing a custom exception for functional programming-related errors.
- msg
a descriptive error message providing details about the exception.
- eo
an optional underlying Throwable that might have caused this exception. Defaults to None if not provided. This class extends
Exception, taking advantage of its constructor to include a message (msg) and optionally a cause (eo.orNullwill passnullto Scala's base exception wheneois None).
- class FunctionIterator[X, R] extends AbstractIterator[Try[R]]
The
FunctionIteratorclass wraps an existing iterator to apply a functionfto its elements, returning an iterator that yieldsTry[R], whereRis the result type of the function application.The
FunctionIteratorclass wraps an existing iterator to apply a functionfto its elements, returning an iterator that yieldsTry[R], whereRis the result type of the function application.This class processes elements from a given iterator of type
Xand handles various scenarios such as: - Validating inputs against a customJoinabletype class. - Handling exceptions during function execution and input processing. - Providing support for "multi-line" inputs that can be joined using theJoinablelogic.- X
The input type of the iterator. Must have an implicit type class
Joinablethat provides methods for validation, joining, and a zero value.- R
The result type produced by applying function
fto elements of typeX.
- Note
The
FunctionIteratormay use a mutable variableryinternally to store the result of the last element processed.
- trait Joinable[T] extends AnyRef
Type class to define behavior of a type that can be joined.
Type class to define behavior of a type that can be joined.
- T
the joinable type.
- class TeeIterator[X] extends Iterator[X]
This iterator gets its input from a Iterator[X], which is essentially a parameterless function.
This iterator gets its input from a Iterator[X], which is essentially a parameterless function. The first n elements of the iterator can be passed to the caller of tee.
NOTE: this is an odd name for the class. Its purpose appears to be to drop the first n elements of an iterator and make them available via tee.
CONSIDER passing the parameter n to the tee method instead of the constructor.
- X
the underlying type.
Value Members
- object FP
Various utilities for functional programming.
- case object InvalidInputException extends Exception with Product with Serializable
The
InvalidInputExceptionis a case object that extends the baseExceptionclass.The
InvalidInputExceptionis a case object that extends the baseExceptionclass. It represents an exception that is thrown when an invalid input is encountered. - case object IteratorExhaustedException extends Exception with Product with Serializable
IteratorExhaustedExceptionis a case object that represents an exception to be thrown when an attempt is made to access an element from an iterator that has been fully traversed.IteratorExhaustedExceptionis a case object that represents an exception to be thrown when an attempt is made to access an element from an iterator that has been fully traversed.This exception helps signal that the iterator is exhausted, meaning no more elements are available for consumption.
- object Joinable
Companion object for the
Joinabletype class, providing default implementations of theJoinablebehavior for specific types. - object Reflection
The
Reflectionobject provides utilities for introspecting case classes using Scala reflection.The
Reflectionobject provides utilities for introspecting case classes using Scala reflection. It is specifically designed to handle field extraction while ensuring compliance with Scala's case class conventions.This functionality is particularly useful for libraries or tools that need metadata or introspection of case class fields, like serializers or mappers.
- object TryUsing