final class DList[A] extends AnyRef
Difference lists: a data structure for O(1)
append on lists.
Based on Data.DList
, a Haskell library by Don Stewart.
A difference list is a function that given a list, returns the original contents of the difference list prepended at the given list.
This structure supports O(1)
append and snoc operations on lists,
making it very useful for append-heavy uses, such as logging and
pretty printing.
- Source
- DList.scala
- Alphabetic
- By Inheritance
- DList
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++(as: ⇒ DList[A]): DList[A]
Append one list to another in constant time.
-
def
+:(a: A): DList[A]
Prepend a single element in constant time.
-
def
:+(a: A): DList[A]
Append a single element in constant time.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(xs: ⇒ IList[A]): Trampoline[IList[A]]
-
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] )
-
def
flatMap[B](f: (A) ⇒ DList[B]): DList[B]
Map over a difference list, then flatten.
-
def
foldr[B](z: ⇒ B)(f: (A, ⇒ B) ⇒ B): B
Fold over a difference list.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
headOption: Option[A]
Get the first element of the list, if any.
-
def
isEmpty: Boolean
Tests whether list is empty.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[B](f: (A) ⇒ B): DList[B]
Map over a difference list.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tailOption: Option[DList[A]]
Get the tail of the list, if any.
-
def
toIList: IList[A]
Convert to an IList.
-
def
toList: List[A]
Convert to a normal list.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
uncons[B](z: ⇒ B, f: (A, DList[A]) ⇒ B): B
List elimination of head and tail.
-
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( ... )
- def zip[B](bs: ⇒ DList[B]): DList[(A, B)]