LazyMonad

com.phasmid.majabigwaduce.core.LazyMonad
See theLazyMonad companion trait
object LazyMonad

Companion object for the LazyMonad type. Provides factory methods to create instances of LazySequence, which is a concrete implementation of LazyMonad.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LazyMonad.type

Members list

Value members

Concrete methods

def apply[T, U](ts: Iterable[T], f: T => U, p: T => Boolean): LazyMonad[T, U]

Method to construct a new LazySequence from an iterable with, effectively, no filter nor predicate.

Method to construct a new LazySequence from an iterable with, effectively, no filter nor predicate.

Type parameters

T

the underlying type of ts.

U

the underlying type of the resulting Iterable.

Value parameters

f

a function to turn a T into a U.

p

A predicate which is a pre-filter (applies to the wrapped values, before being mapped with f).

ts

the iterable to be wrapped.

Attributes

Returns

a new LazySequence based on ts.

def apply[T](ts: Iterable[T]): LazyMonad[T, T]

Method to construct a new LazySequence from an iterable with, effectively, no filter nor predicate.

Method to construct a new LazySequence from an iterable with, effectively, no filter nor predicate.

Type parameters

T

the underlying type of ts.

Value parameters

ts

the iterable to be wrapped.

Attributes

Returns

a new LazySequence based on ts.

def apply[T, U](ts: Iterable[T], f: T => U): LazyMonad[T, U]

Method to construct a new LazySequence from an iterable with a function but no filtration.

Method to construct a new LazySequence from an iterable with a function but no filtration.

Type parameters

T

the underlying type of ts.

U

the underlying type of the resulting Iterable.

Value parameters

f

a function to turn a T into a U.

ts

the iterable to be wrapped.

Attributes

Returns

a LazyMonad[T, U] based on ts and f (with no filtration).

def withFilter[T](ts: Iterable[T], p: T => Boolean): LazyMonad[T, T]

Method to construct a new LazySequence from an iterable with a filter but no function.

Method to construct a new LazySequence from an iterable with a filter but no function.

Type parameters

T

the underlying type of ts.

Value parameters

p

A predicate which is a pre-filter (applies to the wrapped values, before being mapped with f).

ts

the iterable to be wrapped.

Attributes

Returns

a new LazySequence[T, T]