RandomState

com.phasmidsoftware.lascala.random.RandomState
See theRandomState companion object
trait RandomState[T]

Monadic trait which defines a random-state.

Created by scalaprof on 9/24/16.

Type parameters

T

the underlying type of this random state, i.e. the type of the result of calling get

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class JavaRandomState[T]

Members list

Value members

Abstract methods

def get: T

Attributes

Returns

the value of this random state

def map[U](f: T => U): RandomState[U]

Method to map this random state into another random state

Method to map this random state into another random state

Type parameters

U

the underlying type of the resulting random state

Value parameters

f

the function to map a T value into a U value

Attributes

Returns

a new random state

def next: RandomState[T]

Attributes

Returns

the next random state in the pseudo-random series

Concrete methods

def flatMap[U](f: T => RandomState[U]): RandomState[U]

Method to flatMap this random state into another random state

Method to flatMap this random state into another random state

Type parameters

U

the underlying type of the resulting random state

Value parameters

f

the function to map a T value into a RandomState[U] value

Attributes

Returns

a new random state

def toStream: Stream[T]

Attributes

Returns

a stream of T values