object Trampolines
Trampolines. Useful for converting stack-heavy operations into heap-based ones and thereby avoiding stack overflow.
Based on code from "Stackless Scala With Free Monads", Runar Oli Bjarnason.
- Source
- Trampolines.scala
- Alphabetic
- By Inheritance
- Trampolines
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Done
[+A](a: A) extends Trampoline[A] with Product with Serializable
A computation whose value is
a. -
case class
FlatMap
[A, +B](ta: Trampoline[A], k: (A) ⇒ Trampoline[B]) extends Trampoline[B] with Product with Serializable
A computation whose value is obtained by first runnning
tathen passing its value to the continutationkto get the computation that provides the final value. -
case class
More
[+A](k: () ⇒ Trampoline[A]) extends Trampoline[A] with Product with Serializable
A computation whose value is obtained from the computation that is returned by the continuation
k. -
sealed abstract
class
Trampoline
[+A] extends AnyRef
A computation that produces an
A.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
step[A](a: ⇒ A): Trampoline[A]
A computation that returns
awhen it is eventually run. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )