Wrapper

com.phasmidsoftware.lascala.cache.Wrapper
See theWrapper companion object
trait Wrapper[M[_]]

This trait defines a Wrapper of values.

Type parameters

M

represents a container (which is a monad) that we wish to wrap our values in. M is also considered a "higher-kinded type."

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def flatMap[V](m: M[V], f: V => M[V]): M[V]

Return an M[V], given an M[V] and a V=>M[V] function

Return an M[V], given an M[V] and a V=>M[V] function

CONSIDER defining this as flatMap[V,W] etc.

Type parameters

V

the value type

Value parameters

m

the M[V] to be mapped

Attributes

Returns

an M[V]

def get[V](m: M[V]): V

Unwrap a V value from inside the given m

Unwrap a V value from inside the given m

Type parameters

V

the value type

Value parameters

m

an M[V]

Attributes

Returns

the unwrapped V value

def unit[V](v: => V): M[V]

Return an M[V], given v

Return an M[V], given v

Type parameters

V

the value type

Value parameters

v

the value

Attributes

Returns

an M[V]

Concrete methods

def map[V](m: M[V], f: V => V): M[V]

Just for convenience, here is map defined in terms of flatMap and unit

Just for convenience, here is map defined in terms of flatMap and unit

Type parameters

V

the value type

Value parameters

f

the mapping function, which is a V=>V

m

the M[V] to be mapped

Attributes

Returns

an M[V]